调试出错的提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft JET Database Engine 错误 '80040e14'
FROM 子句语法错误。
/reg_chk.asp,行24
表单代码:
<form id="form2" name="form2" method="post" action="reg_chk.asp" onsubmit="return check(this)"><br><br>
<table width="341" height="246" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>用 户 名:</td>
<td><label>
<input name="uname" type="text" id="uname" />
<span class="STYLE2">*</span></label></td>
</tr>
<tr>
<td>密 码:</td>
<td><label>
<input name="pwd1" type="password" id="pwd1" />
<span class="STYLE2">*</span></label></td>
</tr>
<tr>
<td><p>密码确认:</p> </td>
<td><input name="pwd2" type="password" id="pwd2" />
<span class="STYLE2">*</span> </td>
</tr>
<tr>
<td>电子邮箱:</td>
<td><label>
<input name="email" type="text" id="email" />
<span class="STYLE2">*</span></label></td>
</tr>
<tr>
<td>联系电话:</td>
<td><label>
<input name="tel" type="text" id="tel" />
<span class="STYLE2">*</span></label></td>
</tr>
<tr>
<td>联系地址:</td>
<td><input name="add" type="text" id="add" />
<span class="STYLE2">*</span></td>
</tr>
<tr>
<td colspan="2"><label>
<div align="center">
<input type="submit" name="Submit" value="注册" />
<input type="reset" name="Submit2" value="重置" />
</div>
</label></td>
</tr>
</table>
<p> </p>
</form>
插入动作的代码:
<!-- #include virtual="/inc/conn.asp" -->
<!-- #include virtual="/inc/jk_md5.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
If Request.Form("uname")<>"" And Request.Form("pwd1")<>"" And Request.Form("pwd2")<>"" And Request.Form("email")<>"" And Request.Form("tel")<>"" And Request.Form("add")<>"" Then
Dim strSql,sql,uname,password,password1,tel,add,email
uname=Request.Form("uname")
password=Request.Form("pwd1")
password1=Request.Form("pwd2")
tel=Request.Form("tel")
add=Request.Form("add")
email=Request.Form("email")
if password<>password1 then
response.write "<script>alert('两次密码不正确!');</script>"
response.write"<a href='reg1.asp'>返回</a>"
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from user where Name='"&uname&"'"
set rs=conn.execute(sql)
if rs.eof then
password=jk_md5(password,"short")
strSql="insert into user ([Name],[Pwd],[Tel],[Add],[email]) values ('"&uname&"','"&password&"','"&tel&"','"&add&"','"&email&"')"
conn.Execute(strSql)
Response.Write "添加成功!"
Response.Write "<a href='index.asp'>返回首页登录</a>"
Else
Response.Write "该用户已存在!"
Response.Write "<a href='reg1.asp'>重新填写</a>"
End If
End If
End If
%>
<body>
</body>
</html>