主题:  请问这个表单递交到什么页面了?看不懂?

江湖中的宝贝

职务:普通成员
等级:2
金币:1.0
发贴:375
#12004/2/12 3:00:35
<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
%>


不是很明白,请前辈给我提提~!



=ridincal=

职务:管理员
等级:7
金币:20.0
发贴:5886
#22004/2/12 9:23:15
提交到check.asp,不过是加了一个QueryString类型的参数from,帮助判断:
...
if request.querystring("from")="reg" then
...



悲伤的设计

职务:普通成员
等级:1
金币:1.0
发贴:158
#32004/2/12 15:26:06
很正常,有问题吗?对的呀