请问Unix下编写的CGI(C language)的具体方法,有例子最佳!!!

zhangzhiqiang 2000-02-13 12:45:00
...全文
194 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
luckroc 2000-02-14
  • 打赏
  • 举报
回复
请问各位大虾,你们在UNIX下用C语言写过CGI程序并调试通过了吗?
sintony 2000-02-14
  • 打赏
  • 举报
回复
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <string>
void main(int argc,char ** argv,char ** arge)
{
char *lpszQeuryString;
cout << "Content-Type: text/html\n\n";
cout << "Hello World<BR>\n";
lpszQeuryString = getenv( "QUERY_STRING" );
if (lpszQeuryString==NULL) lpszQeuryString="";
cout << "Your input in URL is: ";
cout << lpszQeuryString;
return;
}
xubin_sh 2000-02-14
  • 打赏
  • 举报
回复
#include <stdio.h>
#include <iostream.h>
#include <string>
void main(int argc,char ** argv,char ** arge)
{
string str;
cin >> str;
cout << "content-type:text/html\r\n\r\n";
cout << "abc\r\n<br>";
while ((arge)++,*arge!=NULL){
cout << *arge << "<BR>";
}
freecgi 2000-02-13
  • 打赏
  • 举报
回复
你可以使用CGIC,(www.yahoo.com搜索即可)
自己组织CGI也很容易,市上有很多CGI编程书都谈到了C编写CGI.
最好的例子是广泛使用的wwwcounter.
可到software.silversand.net下载

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧