#include < stdio.h >
#include < stdlib.h >
int main(void)
{
char *data;
long m,n;
printf( "%s%c%c ", "ContentType:text/html;charset=gb2312 ",13,10);
printf( " < TITLE > 乘法结果 < /TITLE > ");
return 0;
}
编译之后产生CGI文件
<html>
<title>
hehe
</title>
<form ACTION= "mult.cgi ">
请在下面填入乘数和被乘数,按下确定后可以看到结果。
<INPUT NAME= "m " SIZE= "5 " >
<INPUT NAME= "n " SIZE= "5 " >
<INPUT TYPE= "SUBMIT " values= "确定 " >
</form>
</html>
这个是HTML文件按按按钮执行以后结果报错为什么
/////////////////////////////////////////
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Content-Type:text/html;charset=gb2312
< TITLE > 乘法结果 < /TITLE >
------解决方案--------------------
输出两个换行符:
printf( "ContentType:text/html;charset=gb2312\n\n ");
写cig 试下 eybuild.
http:/www.eybuild.com