随笔分类 - boa
摘要:【问题】用c编写cgi程序如何取出html表单post来的数据?【分析】html表单post来的数据形如username="zhang"&&password="123456"&&useid="012"【方法1】#include <stdio.h>#include <stdlib.h>#include <string.h> char* getcgidata(FILE* fp, char* requestmethod);int main(){char *input;cha
阅读全文
摘要:1【方法1】(1) 设置cookieprintf( "Set-Cookie:username=%s; path=/; \r\n ",username);printf("Content-type: text/html\n\n");注意:设置cookie的语句要放在Content-type前,否则不能生效。(2) 查看cookieprintf("Content-type: text/html\n\n");printf("<html>\n"); info=getenv("HTTP_COOKIE&qu
阅读全文
浙公网安备 33010602011771号