最简单的cgi程序,为什么运行时出错?

pig_2000 2006-06-06 05:20:05
#include <stdio.h>
#include <stdlib.h>

void main()
{
printf("Content-type:text/html\n\n");

printf("<html>\n");
printf("000000000\n");
printf("</html>\n");

fflush(stdout);
}

放到web服务器后,访问时出错
错误提示
“CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.”

谁知道为什么会出现这种问题?
...全文
401 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
运动健将 2006-06-09
  • 打赏
  • 举报
回复
把printf("Content-type:text/html\n\n");改成printf("Contenttype:text/html\n\n");没有里面的哪个-东西
newzy 2006-06-07
  • 打赏
  • 举报
回复
按照 CGI1.1 SPEC 这个程序一点问题都没有

这是服务器的原因.
试问用的是什么 web 服务器?
ykj76 2006-06-07
  • 打赏
  • 举报
回复
看不出来错在那里
铁文 2006-06-06
  • 打赏
  • 举报
回复
httpheader不全,需要HTTP/1.1之类的信息头

2,204

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧