随笔分类 -  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 阅读全文
posted @ 2011-10-11 14:45 j2ee技术 阅读(748) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2011-09-30 20:56 j2ee技术 阅读(387) 评论(0) 推荐(0)