<form name="form1" method="post" action="check.asp?from=reg">
<table width="499" border="1" align="center" cellpadding="3" cellspacing="0">
<tr>
<td width="247">用户名</td>
<td width="524"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td>性别</td>
<td><input name="sex" type="radio" value="男" checked>
男 <input type="radio" name="sex" value="女">
女</td>
</tr>
<tr>
<td>婚否</td>
<td><input name="married" type="checkbox" id="married" value="-1"></td>
</tr>
<tr>
<td>出生日期</td>
<td><input name="birthday" type="text" id="birthday"></td>
</tr>
<tr>
<td>联系地址</td>
<td><input name="address" type="text" id="address"></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="Submit" value="注 册"></td>
</tr>
</table>
</form>
什么是???action="check.asp?from=reg"
check.asp页面的内容是:
<%
set db=server.createobject("adodb.connection")
db.open "DBQ="&server.mappath("data/user.mdb")&";driver={microsoft access driver (*.mdb)}"
username=trim(request.form("username"))
if request.querystring("from")="reg" then
sql="select * from userinfo where username='"&username&"'"
set rs=db.execute(sql)
if not rs.eof or not rs.bof then
response.redirect("reg_error.htm")
else
password=request.form("password")
sex=request.form("sex")
married=request.form("married")
if married="" then
married=0
end if
birthday=request.form("birthday")
address=request.form("address")
insertsql="insert into userinfo(username,password,sex,married,birthday,address) values('"&username&"','"&password&"','"&sex&"',"&married&",#"&birthday&"#,'"&address&"')"
db.execute(insertsql)
db.close
set db=nothing
response.redirect("reg_ok.htm")
end if
end if
if request.QueryString("from")="login" then
sql="select * from userinfo where username='"&username&"' and password='"&request.form("password")&"'"
set rs=db.execute(sql)
if not rs.eof or not rs.bof then
response.redirect("login_ok.htm")
else
response.Redirect("login_error.htm")
end if
end if
%>
不是很明白,请前辈给我提提~!