| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 527 人关注过本帖
标题:ASP注册连接SQL问题
只看楼主 加入收藏
cc2008
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-5-10
收藏
 问题点数:0 回复次数:0 
ASP注册连接SQL问题
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>真孔雀王</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #000000;
}
body,td,th {
color: #CCCCCC;
font-size: 12px;
}
input {
background-color:#999999;
}
select {
background-color:#999999;
}
-->
</style>
<link href="/images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #999999}
-->
</style>
</head>
<body>
<!-- #include file="../inc/head.asp" -->
<!-- #include file="include/conn.asp" -->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#270F01" style="background-image: url(/images/body_bg.jpg);background-repeat: repeat-x;">
<tr valign="top">
<td width="194"> <img src="../images/reg_11.jpg" width="194" height="309" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="67,59,124,76" href="reg.asp">
<area shape="rect" coords="68,91,125,106" href="login.asp">
<area shape="rect" coords="67,122,122,138" href="activate.asp">
<area shape="rect" coords="67,152,123,170" href="add.asp">
<area shape="rect" coords="66,180,124,199" href="changeinfo.asp">
<area shape="rect" coords="66,211,124,229" href="changepass.asp">
<area shape="rect" coords="66,243,125,260" href="lostpass.asp">
<area shape="rect" coords="65,275,123,293" href="faq.asp">
</map> </td>

<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/reg_1.jpg" width="587" height="29"></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image: url(/images/news_r_bg1.jpg);background-position: center top;">
<tr>
<td style="background-image: url(/images/news_r_bg0.jpg);background-repeat: no-repeat;background-position: center top;"><table width="561" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td align="center">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<%
ps_loginname = chkinput(request("id_N"))
ps_password = chkinput(request("pwd_P"))
ps_repassword = chkinput(request("pwd1_P"))
ps_name = chkinput(request("UserName_C"))
ps_email = chkinput(request("email_E"))
ps_question = chkinput(request("ques"))
ps_answer = chkinput(request("answ"))
ps_person_id = chkinput(request("IDNO_D"))
ps_phone = chkinput(request("Tel_T"))
ps_sex = chkinput(request("sex"))
ps_address = chkinput(request("add_C"))
ps_zipcode = chkinput(request("zip_I"))
ps_assist_id = chkinput(request("assist_id"))
ps_handphone = chkinput(request("handphone"))
ps_job = chkinput(request("job"))

response.write "<br>"

if ps_password <> ps_repassword then
errormsg="<li>您两次输入的密码不相同,请返回上一步正确输入您的密码!"
end if

if not chkstring(ps_loginname,"帐号",0,0,"none",1,4,12) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if not chkstring(ps_password,"密码",0,0,"%&=",1,4,12) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if not chkstring(ps_name,"真实姓名",0,1,"none",0,-1,10) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if not chkstring(ps_address,"联系地址",1,1,"%&=",1,-1,30) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if not chkstring(ps_phone,"联系电话",1,0,"`~!@#$%^&*(){}=+\:;'""<>,./?",1,7,20) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if not chkstring(ps_handphone,"手机号码",1,0,"`~!@#$%^&*(){}=+\:;'""<>,./?",1,11,11) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if not chkstring(ps_person_id,"身份证号码",0,0,"`~!@#$%^&*(){}=+\:;'""<>,./?",1,13,18) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if len(ps_question) = 0 or len(ps_answer) = 0 or len(ps_question) > 40 or len(ps_answer) > 20 then
response.write "<li>密码提示问题或答案填写错误<br>"
end if

if not isemail(ps_email) then
response.write "<br>"
errormsg = errormsg & errmsg
end if

if errormsg="注册信息有错误......" then
%>
<tr>
<td colspan="2" align="center"><strong>注册成功</strong></td>
</tr>
<tr>
<td colspan="2" align="center">&nbsp;</td>
</tr>
<tr>
<td><strong>登陆名称:</strong></td>
<td><%=ps_loginname%></font></td>
</tr>
<tr>
<td><strong>电子邮箱:</strong></td>
<td><%=ps_email%></td>
</tr>
<tr>
<td><strong>证件号码:</strong></td>
<td><%=ps_person_id%></td>
</tr>
<tr>
<td><strong>密码找回提示问题:</strong></td>
<td><%=ps_question%></td>
</tr>
<tr>
<td><strong>密码找回提示答案:</strong></td>
<td><%=ps_answer%></td>
</tr>
<%
set rs1 = Server.CreateObject("ADODB.Recordset")
sql="select * from member_info where id = '"&ps_loginname&"'"

rs1.open sql,conn ,1,1

if not rs1.eof then
response.write "<script language=JavaScript>" & chr(13) & "alert('用户名已经存在!');" & "history.back()" & "</script>"
else
set rs2 = Server.CreateObject("ADODB.Recordset")
sql="insert into member_info (id,name,email,pw,pw_check,pw_answer,id_no,phone,sex,address,zip,assist_id,handphone,job_code) VALUES ('"&ps_loginname&"' ,'"&ps_name&"' ,'"&ps_email&"', '"&ps_password&"', '"&ps_question&"', '"&ps_answer&"', '"&ps_person_id&"', '"&ps_phone&"', '"&ps_sex&"', '"&ps_address&"', '"&ps_zipcode&"', '"&ps_assist_id&"', '"&ps_handphone&"', '"&ps_job&"')"
set rs2=conn.execute(sql)
%>
<tr align="center"><td colspan="2"><br>您的帐号<font color="#FF0000"><%=ps_loginname%></font>成功注册!</font></td></tr>
<% end if%>
<% end if%>
</table>
</td>
</tr>
</table> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/images/news_r_end.jpg" width="587" height="21"></td>
</tr>
</table></td>
</tr>
</table>
<!--#include file="../inc/bottom.asp"-->

</body>
</html>




..
显示注册成功,但是数据库里没信息。。。
拜托帮忙了。。。
搜索更多相关主题的帖子: content color style title 
2006-05-10 03:18
快速回复:ASP注册连接SQL问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035340 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved