做的注册页面怎么不调用检查保存页面?
register.asp 注册页面<html>
<head>
<title>新用户注册----在线考试系统</title>
</head>
<body>
<form name="form1" method="post" action="register.asp?action=usersave">
<!--#include file="conn.asp"-->
<style type="text/css">
<!--
.STYLE5 {font-size: 12px}
-->
</style>
<table width="269" height="110" border="0" align="center">
<tr>
<td width="109" class="STYLE5 STYLE5">用户名:</td>
<td width="150"><input name="nam" type="text" class="text" id="nam"></td>
</tr>
<tr>
<td class="STYLE5">密码:</td>
<td><input name="pwd" type="password" class="text" id="pwd"></td>
</tr>
<tr>
<td class="STYLE4"><span class="STYLE5">请再次输入密码:</span></td>
<td><input name="pwd1" type="password" class="text" id="pwd1"></td>
</tr>
<tr>
<td colspan="2"><div align="center" class="STYLE1">
<input name="Submit" type="submit" value="确认">
<input type="submit" name="Submit2" value="返回">
</div></td>
</tr>
</table>
</form>
</body>
</html>
usersave.asp页面
<!--#include file="conn.asp"-->
<%
If Request("action") = "usersave" Then
Call usersave()
End If
%>
<%
Sub usersave()
dim nam
dim pwd
dim pwd1
nam=trim(request.Form("nam"))
pwd=trim(request.Form("pwd"))
pwd1=trim(request.Form("pwd1"))
if nam="" then
response.Write"<script>alert('请输入用户名!');histroy.go(-1);</script>"
response.End
elseif pwd="" or pwd1=""then
response.Write"<script>alert('请输入密码!');history.go(-1);</script>"
response.End
elseif pwd<>pwd1 then
response.Write"<script>alert('两次输入的密码不一样!')history.go(-1);</script>"
response.End
elseif len(pwd)< 6 or len (pwd1)<6 then
response.Write"<script>alert('密码不能少于6位')history.go(-1);</script>"
response.End
else
set rs=server.CreateObject("ADODB.Recordset")
sql="select * From student Where stuname='"&nam&"'"
rs.open sql,conn,3,3
if not rs.EOF then
response.Write"<script>alert('该帐号已被注册')history.go(-1);</script>"
response.End
else
rs.addnew
rs("stuname")=nam
rs("pwd")=pwd
rs.update
response.Redirect("index.asp")
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end sub
%>
[[it] 本帖最后由 cilubutong 于 2008-11-27 11:47 编辑 [/it]]