2,204
社区成员
发帖
与我相关
我的任务
分享
#include"cgic.h"
#include"cgic.c"
#include<iostream>
using namespace std;
int cgiMain()
{
char user[20],password[20];
cgiFormString("user",user,20);
cgiFormString("password",password,20);
string strOfuser(user);
string strOfpassword(password);
string str1("chen");
string str2("123");
if(cgiFormSubmitClicked("redir")==cgiFormSuccess){
if(strOfuser.compare(str1)==0 && strOfpassword.compare(str2)==0)
{
cgiHeaderLocation("/var/www/index.html");
}
else
{
cgiHeaderLocation("/var/www/redir.html");
}
}
cgiHeaderContentType("text/html");
return 0;
}
<TITLE>短信平台登录</TITLE>
<FORM METHOD="post"ACTION="/cgi-bin/xs.cgi"
<p align="center">短信平台登录 </p>
<div>
用户名:<INPUT type="text" name="user"><p>
密码: <input TYPE="password" NAME="password"><p>
<input type="submit" name="redir" value="确定"/>
<input type="RESET" VALUE="取消"/〉<p>
</div>
</FORM>