调用cgi脚本文件的例子
当cgi脚本被执行的时候,可以被它访问的主要环境变量有:
环境变量
内容
query_string
数据通过它的调用者发送给cgi脚本。这可能是来自表单或者其它动态或者静态产生数据的输出。
remote_addr
产生请求的主机的inte.net地址
以下的一个c++程序可以实现当它运行的时候,打印出cgi脚本的许多有效的环境变量:
#include "t99_type.h"
#include
#include
#include
#include
#include
#include
#include "mas_cvo.cpp"
// main program
int main()
{
html("content-type: text/html"); html(""); // 输出类型
cgi_var_output(); // 环境变量
return 0;
}
上面的程序当然还需要两个文件,即t99_type.h和mas_cvo.cpp。具体代码请看下一页。
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器