- 论坛徽章:
- 0
|
回复 4# chenyx
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *data;
long m,n;
printf("%s%c%c ","Content-Type:text/html;charset=utf-8",13,10);
printf("<html> <head>");
printf("<title> the title </title>");
printf(" </head> <body>");
printf("<H3> hahaha </h3>");
data = getenv("QUERY_STRING");
if(data==NULL) printf("<p>no string input!!!</p>");
else if(sscanf(data,"m=%ld&&n=%ld",&m,&n)!=2) printf("<P>num is not enough</P>");
else
printf("<P>the mult is :%ld * %ld =%ld</p>",m,n,m*n);
printf("</body> </html>");
return 0;
}
就是这个相乘的程序。然后生成这样的一个文件
。
接下来这个图片是整个服务器里的文件夹
另外,试了另一个thttpd,居然返回404错误,“404 Not Found
The requested URL '/cgi-bin/printenv.sh' was not found on this server.”
这是conf中的配置是这样的:
# This section overrides defaults
dir=/home/httpd/html
#chroot
user=httpd# default = nobody
logfile=/var/log/thttpd.log
pidfile=/var/run/thttpd.pid
# This section _documents_ defaults in effect
port=80
# nosymlink# default = !chroot
# novhost
cgipat=/cgi-bin/*
# nothrottles
# host=0.0.0.0
# charset=iso-8859-1
有问题吗? |
|