ImageVerifierCode 换一换
格式:DOCX , 页数:33 ,大小:21.09KB ,
资源ID:1478208      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-1478208.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(cgiWord格式.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

cgiWord格式.docx

1、HEADTITLE%s/HEAD, title);void htmlBody() BODYvoid htmlFooter() /BODY/HTMLvoid addTitleElement(char *title) H1/H1, title);/* cgivars.c * (C) Copyright 2000, Moreton Bay (). * see HTTP (www.w3.org) and RFC */stdlib.hsignal.herrno.hunistd.hsys/stat.hsys/time.hsys/wait.hstatic voidcatchchild() char buf4

2、0; pid_t pid; int status; /*signal(SIGCHLD, catchchild);*/ /* Unneeded */ pid = wait4(-1, &status, WUNTRACED, 0); if (WIFSTOPPED(status) sprintf(buf, sh %d: Child %d stoppedn, getpid(), pid); else Child %d diedn /if (intcrlf) / write(STDOUT, n, 1); write(STDOUT, buf, strlen(buf); setenv (NIOSSHELL,b

3、uf ,1);int execfile(cmd, bg, fplog) char *cmd; int bg; FILE *fplog; int pid; char *myargvMAXARGS; struct sigaction act; int j=0; /myargvj+ = strtok (/bin/nios2io wd 80681070 127, myargvj+ = strtok (cmd, while (jMAXARGS&(myargvj+=strtok(NULL,)!=NULL); if (bg=0) signal(SIGCHLD, SIG_DFL); /* * No magic

4、 characters in the expanded command, so do the fork and * exec ourself. If this fails with ENOEXEC, then run the * shell anyway since it might be a shell script. if (!(pid = vfork() int ci; /* * We are the child, so run the program. * First close any extra file descriptors we have opened. * be sure

5、not to modify any globals after the vfork ! */ signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); execvp(myargv0, myargv); printf(%s: %sn, myargv0, (errno = ENOENT) ?Bad command or file name : strerror(errno); fprintf(fplog, _exit(0); if (pid = A ? (hex0 & 0xdf) - ) + 10 : (hex0 - 0); char_value *=

6、16; char_value += (hex1 (hex1 & (hex1 - return char_value;/* unescape_url */void unescape_url(char *url) int n, k; for(n=0, k=0;urlk;+n, +k) if(urln = urlk) = %) urln = hex2char(&urlk+1); k += 2; urln = 0;/* getRequestMethod * retn: from_method (GET or POST) on success, * -1 on failure. */int getReq

7、uestMethod() char *request_method; request_method = getenv(REQUEST_METHOD if(request_method = NULL) return -1;strcmp(request_method, GET) | !HEAD) ) form_method = GET; else if (!POST) form_method = POST; else /* wtf was it then?! return form_method;/* getGETvars getvars */char *getGETvars() int i; c

8、har *getvars; char *getinput; char *pairlist; int paircount = 0; char *nvpair; char *eqpos; getinput = getenv(QUERY_STRING if (getinput) getinput = strdup(getinput); /* Change all plusses back to spaces */ for(i=0; getinput & getinputi; i+) if(getinputi = +) getinputi = pairlist = (char *) malloc(25

9、6*sizeof(char *); paircount = 0; nvpair = getinput ? strtok(getinput, ) : NULL; while (nvpair) pairlistpaircount+= strdup(nvpair); if(!(paircount%256) pairlist = (char *) realloc(pairlist,(paircount+256)*sizeof(char *); nvpair = strtok(NULL, pairlistpaircount = 0; getvars = (char *) malloc(paircount

10、*2+1)*sizeof(char *); for (i= 0; ipaircount; i+) if(eqpos=strchr(pairlisti, = *eqpos = unescape_url(getvarsi*2+1 = strdup(eqpos+1); else unescape_url(getvarsi*2+1 = strdup( unescape_url(getvarsi*2 = strdup(pairlisti); getvarspaircount*2 = 0;pairlisti;i+) free(pairlisti); free(pairlist); free(getinpu

11、t); return getvars;/* getPOSTvars postvars */char *getPOSTvars() int i,j,k; int content_length; char *postvars; char *postinput; char *content_type; FILE *df; FILE *fplog = fopen(/log.txtw if( NULL = fplog ) %s nicht gefunden!, log.txt exit (1); content_type = getenv(CONTENT_TYPEcontent_type) no Con

12、tent typen fclose(fplog); /df = fopen(/content.html /fwrite(content_type,1,(int)strlen(content_type),df); /fclose(df); postinput = getenv(CONTENT_LENGTHpostinput) no Content lengthn if(!(content_length = atoi(postinput) (postinput = (char *) malloc(content_length+1) fread(postinput, content_length,

13、1, stdin) postinputcontent_length = /post.html /fwrite(postinput,1,content_length,df); /fprintf(fplog,wrote post.htmln char stringToFind=multipart/form-data; boundary= /for normal html post requests if (NULL = strstr(content_type, stringToFind) for(i=0;postinputi; if(postinputi = postinputi = pairli

14、st = (char *) malloc(256*sizeof(char *); nvpair = strtok(postinput, pairlistpaircount+ = strdup(nvpair); pairlist = (char *) realloc(pairlist, (paircount+256)*sizeof(char *); nvpair = strtok(NULL, pairlistpaircount = 0; postvars = (char *) malloc(paircount*2+1)*sizeof(char *); for(i = 0;iDEBUG: %s =

15、 %sn, i, postvarsi, postvarsi+1); if(strstr(postvarsi,LEDR if (*(postvarsi+4)=1 /ledR &= (10); ledR |= 10; else if (*(postvarsi+4)=21;32;43;54;65;76;87;98;9;B10;C11;D12;E13;F14;G15;H16;I17; ledR_changed=1; %s = %s : LEDR = %08Xn, i, postvarsi, postvarsi+1, ledR); else if(strstr(postvarsi,LEDG ledG |= 1 else if (*(postvarsi

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2