#include <stdio.h>
#include "cgic.h"
#include <string.h>
#include <stdlib.h>
int cgiMain()
{
char username[25]= "uuuu ";
char pass[25] = "123 ";
//printf( "Set-Cookie:username=%s;Set-Cookie:password=%s\n ",username,pass);
//printf( "Set-Cookie: username=%s; path=/\r\n ", username);
//printf( "Set-Cookie: password=%s; path=/\r\n ", pass);
//cgiHeaderCookieSetString("user","USER",3600,cgiScriptName,192.168.10.43);
cgiHeaderCookieSetString("user","USER",3600,"/","192.168.10.229");
cgiHeaderCookieSetString("pp","PPP",3600,cgiScriptName,"192.168.10.229");
printf( "Set-Cookie:pass=ok;max-age=600;path=/\r\n");
cgiHeaderContentType( "text/html");
printf("Cookie:%s\n",getenv("HTTP_COOKIE"));
printf( " <a href=test2> 2111 </a> ");
return 0;
}
----------------------------------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "cgic.h"
int cgiMain()
{
cgiHeaderContentType("text/html");
printf("Cookie:%s\n",getenv("HTTP_COOKIE"));
printf("i:%s\n",getenv("REMOTE_ADDR"));
return 0;
}