您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > thttpd使用方法探讨
看看是怎么把cgi放进去跑起来的=99&n=885这样可以成功访问1#Thissectionoverridesdefaults2dir=/mnt/mmc3#chroot4user=root#default=nobody5logfile=/var/log/thttpd.log6pidfile=/var/run/thttpd.pid7#Thissection_documents_defaultsineffect8#port=809#nosymlink#default=!chroot10#novhost11cgipat=/cgi-bin/*12#nothrottles13#host=0.0.0.014#charset=iso-8859-1按照下面的=99&n=885这样也能成功获取数据吗?试试看,只是改了路径而已。1#Thissectionoverridesdefaults2dir=/mnt/mmc/cgi-bin/3#chroot4user=root#default=nobody5logfile=/var/log/thttpd.log6pidfile=/var/run/thttpd.pid7#Thissection_documents_defaultsineffect8#port=809#nosymlink#default=!chroot10#novhost11cgipat=*12#nothrottles13#host=0.0.0.014#charset=iso-8859-1居然不行,后面把phf这个文件重命名为index.cgi就可以了,名字很重要!默认访问的cgi程序就是这么来的,搞定,搞定了!!!#includestdio.h#includestdlib.hintmain(void){char*data;printf(Content-Type:text/xml\r\n\r\n);printf(?xmlversion=\1.0\encoding=\utf-8\?);//printf(H3Multiplicationresults/H3\n);data=getenv(QUERY_STRING);if(data==NULL)printf(Errorinpassingdatafromformtoscriptorhasnodatatowebserver.);Char*tmp=strtok(data,”&”);printf(“funtion”);While(tmp){Charkey[256],value[256];sscanf(tmp,%[^=]=%s,key,value);printf(“%s%s/%s”,key,value,key);tmp=strtok(NULL,”&”);}printf(“/funtion”);return0;}~~
本文标题:thttpd使用方法探讨
链接地址:https://www.777doc.com/doc-2862994 .html