文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>利用CGIC获得URL参数

利用CGIC获得URL参数

时间:2010-12-04  来源:dongliqiang1985

源码如下:
cgitest_qiang.c

#include <stdio.h>
#include <string.h>
//#include <stdlib.h>

#include "cgic205/cgic.h"

extern char *cgiQueryString;

int cgiMain()
{
    char id[10];    
    cgiHeaderContentType("text/html");
    fprintf(cgiOut, "<HTML>\n");
    fprintf(cgiOut, "<HEAD>\n");
    fprintf(cgiOut, "<TITLE>My First CGI</TITLE>\n");
    fprintf(cgiOut, "</HEAD>\n");
    fprintf(cgiOut, "<BODY>\n");    
    fprintf(cgiOut, "<H1>%s</H1>\n",cgiQueryString);

    cgiFormString("id",id,strlen(id));
    fprintf(cgiOut, "%s<br>\n",id);

    if(strcmp(id,"0")==0)
    {    
        fprintf(cgiOut, "id is %s! \n",id);
    }
    else
    {
        fprintf(cgiOut, "id is not 0! \n");
    }
    fprintf(cgiOut, "</BODY>\n");
    fprintf(cgiOut, "</HTML>\n");

    return 0;
}


Makefile

CFLAGS=-g -Wall CC=gcc AR=ar RANLIB=ranlib LIBS=-L./cgic205 -lcgic CP=cp TARGET_DIR =/var/www/appweb-default/test all:clean cgitest_qiang.cgi install cgitest_qiang.cgi: cgitest_qiang.c $(CC) -o cgitest_qiang.cgi ${LIBS} cgitest_qiang.c install: $(CP) cgitest_qiang.cgi $(TARGET_DIR) clean: rm -f *.o cgitest_qiang.cgi


文件: cgitest.zip
大小: 227KB
下载: 下载
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载