其他的都可以的
我在数据库里直接添加了个密码 登陆也正常的
各位帮忙 看下 我是新来的 也是个新手 谢谢!
部分代码:
<td colspan="3" align="left" class="STYLE2">注册新会员:(带*号的必填)</td>
</tr>
<tr>
<td width="145" align="right">登录名称:</td>
<td width="280" align="left"><input type="text" name="login_name" /></td>
<td width="373" align="left">* 6-18个英文字母和数字 </td>
</tr>
<tr>
<td align="right">客户名称:</td>
<td align="left"><input type="text" name="client_name" /></td>
<td align="left">* 请填写与银行帐号对应的正确中文名 </td>
</tr>
<tr>
<td align="right">您的密码:</td>
<td align="left"><input name="password1" type="password" size="18" /></td>
<td align="left">* 长度6-18位英文字母和数字</td>
</tr>
<tr>
<td align="right">确认密码:</td>
<td align="left"><input name="password2" type="password" size="18" /></td>
<td align="left">* 再次输入一次密码 </td>
</tr>
验证代码:
<%
if Trim(Request.Form("login_name"))="" or Trim(Request.Form("client_name"))="" or Trim(Request.Form("password1"))="" or Trim(Request.Form("password2"))="" then
Response.write("<script>alert('数据不能为空');window.history.go(-1);</script>")
Response.end()
end if
if len(Trim(Request.Form("login_name")))>18 or len(Trim(Request.Form("login_name")))<6 then
Response.write("<script>alert('登录名称必须是6-18位英文字母和数字');window.history.go(-1);</script>")
Response.end()
end if
if len(Trim(Request.Form("password1")))>18 or len(Trim(Request.Form("password1")))<6 then
Response.write("<script>alert('密码必须是6-18位英文字母和数字');window.history.go(-1);</script>")
Response.end()
end if
if Trim(Request.Form("password1"))<>Trim(Request.Form("password2")) then
Response.write("<script>alert('两次密码不一致');window.history.go(-1);</script>")
Response.end()
end if
注册代码:
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data.mdb")
exec="select * from register where login_name='"&request.form("login_name")&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
if rs.eof then
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data.mdb")
login_name=request.form("login_name")
client_name=request.form("client_name")
password1=request.form("password")
telephone=request.form("telephone")
fax=request.form("fax")
mobile=request.form("mobile")
province=request.form("province")
city=request.form("city")
county=request.form("county")
bank=request.form("bank")
bank_id=request.form("bank_id")
address=request.form("address")
email=request.form("email")
postalcode=request.form("postalcod")
exec="insert into register(login_name,client_name,password,telephone,fax,mobile,province,city,county,bank,bank_id,address,email,postalcode)value('"+login_name+"','"+client_name+"','"+password1+"','"+telephone+"','"+fax+"','"+mobile+"','"+province+"','"+city+"',
'"+county+"','"+bank+"','"+bank_id+"','"+address+"','"+email+"','"+postalcode+"')"
conn.execute exec
conn.close
set conn=nothing
else
Response.write("<script>alert('用户名已存在');window.history.go(-1);</script>")
Response.end()
end if
%>