#12004/3/7 8:45:55
为什么我这样写的代码不会在数据库中插入新用户呢
<%
dim sql,sql1
sql1="select name from users where name ='" & request.Form("name") & "'"
sql="insert into users values('" & request.Form("name") & "')"
if request.Form("action")="提交" then
Set RS1=conn.execute(sql1)
if NOT RS1.EOF then
response.write"<script>alert('对不起,该用户名已经被注册');history.back();</script>"
response.end
else
set RS2=conn.execute(sql)
response.write"<script>alert('恭喜,注册成功');history.back();</script>"
response.end
end if
end if
%>
...
<form method="post" action="reg.asp" name="reg">
<Script Language="javascript">
<!--
function submitclick()
{cnt=0;
errstr="请注意以下填写要点: \n\n";
zcm=document.reg.name.value;
if(zcm=="")
{cnt=cnt+1;
errstr=errstr+cnt+"."+"请输入您的用户名,不要使用特殊字符\n";
}
}
//--></Script>
<input name="name" type="text" maxlength="20">
<input type="submit" name="action" value="提交" onClick="return submitclick();"> <input type="reset" name="Submit2" value="重填">
...