|
这是reg.asp的代码:
<!--#include file="conn.asp"-->
<%
if request("action")="reg" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from user where name='"&trim(request("name"))&"'",conn,1,1
if rs.recordcount>0 then
response.write "<script language='javascript'>window.alert('您输入的用户名已存在,请返回重新输入!');history.back(-1);</script>"
response.end()
end if
sql="select * from user"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("name")=trim(request.form("name"))
rs("pwd")=trim(request.form("pwd"))
rs("wenti")=trim(request.form("wenti"))
rs("daan")=trim(request.form("daan"))
rs.update
rs.close
set rs=nothing
response.write "<script language=javascript> alert('注册成功,点击确定立即登录!');location.replace('login.asp');</script>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body><!--#include file="top.asp"-->
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0">
<tr>
<td>用户注册
<form name="form1" method="post" action="?action=reg" onSubmit="return chkform(this)">
<table width="347" border="1" cellpadding="5" cellspacing="0">
<tr>
<td width="142">用户名</td>
<td width="179"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="pwd" type="password" id="pwd"></td>
</tr>
<tr>
<td>密码提示问题</td>
<td><input name="wenti" type="text" id="wenti"></td>
</tr>
<tr>
<td>密码提示答案</td>
<td><input name="daan" type="text" id="daan"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="注册">
<input type="reset" name="submit" value="重置"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
为什么只可以读取ACCESS的数据,却写不进去?各位帮帮忙啦!在线等回复! |
|