| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 502 人关注过本帖
标题:表单提交问题
只看楼主 加入收藏
zxk8
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-8-4
收藏
 问题点数:0 回复次数:3 
表单提交问题

<!--#include file="conn.asp"-->

<!--#include file="webconfig.asp"-->
<!--#include file="fuction.asp"-->
<!--#include file="Include/function.asp"-->
<%
On Error Resume Next
dim action
action=request.QueryString("action")
%>
<html>
<head>
<title><%=webname%> - <%=webgjz%></title>
<meta name=keywords content="<%=webgjz%>">
<meta name="description" content="<%=webmx%>">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="img/css.css" rel="stylesheet" type="text/css" />
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.cosmetic_border {border-left:2px solid #FFA1C3;border-right:2px solid #FFA1C3}
.dress_bottom {border-bottom:0px solid #DD85D3}
-->
</style>
</head>
<body bgcolor="#ffffff">
<!--#include file="top.asp"-->
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="201" valign="top"><div id="div"></div>
<div style="margin-bottom:5px;"></div>
<table width="194" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="38" background="img/lady_left_bg_03.gif">&nbsp;</td>
</tr>
</table>
<table width="194" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="img/01_bg07.gif"><%
set rs=server.CreateObject("adodb.recordset")
rs.open "select anclass,anclassid,sztys from shop_anclass",conn,1,1
if rs.recordcount=0 Then
response.write "目前没有商品分类"
Else
while not rs.eof
%>
<table width="177" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="16" colspan="4" align="left" valign="bottom" background="img/01_bg06.gif" style='padding-left: 5px'><div align="center"><a href="Class_<%=rs("anclassid")%>_1.html"><font color="<%=trim(rs("sztys"))%>"><b><%=trim(rs("anclass"))%></b></font></a></div></td>
</tr>
<%
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select nclass,nclassid,xsztys from shop_nclass where anclassid="&rs("anclassid")&" order by nclassidorder",conn,1,1
if rs_s.recordcount=0 Then
%>
<%
Else
i=0
while not rs_s.eof
%>
<tr>
<td width="66" height="20" align="right"><a href="Nclass_<%=rs("anclassid")%>_<%=rs_s("nclassid")%>_1.html"><font color="<%=trim(rs_s("xsztys"))%>"><%=trim(rs_s("nclass"))%></font></a></td>
<td width="12" align="center"><font color="#FF0000">·</font></td>
<%
rs_s.movenext
if rs_s.eof Then
Response.Write "<td>&nbsp;</td>" & vbNewLine
Else
%>
<td width="86" height="20" align="left"><a href="Nclass_<%=rs("anclassid")%>_<%=rs_s("nclassid")%>_1.html"><font color="<%=trim(rs_s("xsztys"))%>"><%=trim(rs_s("nclass"))%></font></a></td>
</tr>
<%
rs_s.movenext
end If
%>
<%
Wend
end If
%>
</table>
<%
rs_s.close
set rs_s=Nothing
rs.movenext
wend
end if
rs.close
set rs=nothing
%></td>
</tr>
</table>
<table width="194" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><img src="img/lady_left_bg_04.gif" /></td>
</tr>
</table>
<div style="margin-bottom:5px;"></div>
<div ></div></td>
<td width="699" valign="top"><div class="left_space_head">
<table width="701" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="701" height="34" background="img/01_bg09.gif"><table width="95%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="39">&nbsp;</td>
<td width="622" height="28" align="left">您现在的位置是:<a href="<%=weburl%>"><%=webname%></a> -&gt; 用户注册</td>
</tr>
</table></td>
</tr>
</table>
</div>
<table class="cosmetic_border" id="lady_cosmetic" cellspacing="0" cellpadding="0" width="701">
<tbody>
<tr>
<td width="695" class="dress_bottom"><table width="99%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td><table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><%
select case action
case ""%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100"><br />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="33"><div align="center">
<table width="500" border="0" cellspacing="0" cellpadding="0" height="31">
<tr>
<td height="22"><div align="center"><span style="font-size: 14"><b><%=webname%>注册条约</b></span></div></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#F7F7F7"><table width="95%" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td align="left"><br />
<%call tiaoyue()%>
<br /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<div align="center" class="clogin">
<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<form action="reg.asp?action=yes" method="post" name="form1" id="form1">
<td height="36"><div align="center">
<input type="submit" name="Submit2" class="c2" value="接受条约注册"/>
</div></td>
</form>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
</table>
<%case "yes"%>
<script language="JavaScript" type="text/javascript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.userinfo.username.value)) {
document.userinfo.username.focus();
alert("对不起,请填写用户名!");
return false;
}
if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6 || document.userinfo.userpassword.value.length >20) {
document.userinfo.userpassword.focus();
alert("密码长度不能不能这空,在6位到20位之间,请重新输入!");
return false;
}
if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
document.userinfo.userpassword.focus();
document.userinfo.userpassword.value = '';
document.userinfo.userpassword1.value = '';
alert("两次输入的密码不同,请重新输入!");
return false;
}

if(document.userinfo.useremail.value.length!=0)
{
if (document.userinfo.useremail.value.charAt(0)=="." ||
document.userinfo.useremail.value.charAt(0)=="@"||
document.userinfo.useremail.value.indexOf('@', 0) == -1 ||
document.userinfo.useremail.value.indexOf('.', 0) == -1 ||
document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 ||
document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
{
alert("Email地址格式不正确!");
document.userinfo.useremail.focus();
return false;
}
}
else
{
alert("Email不能为空!");
document.userinfo.useremail.focus();
return false;
}
if(checkspace(document.userinfo.quesion.value)) {
document.userinfo.quesion.focus();
alert("对不起,请填写密码提问!");
return false;
}
if(checkspace(document.userinfo.answer.value)) {
document.userinfo.answer.focus();
alert("对不起,请填写密码提问的答案!");
return false;
}
//document.userinfo.submit();
}

//-->
</script>
<form action="reg.asp?action=save" method="post" name="userinfo" id="userinfo" >
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100"><div class="clogin">
<table width="65%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#ffffff">
<td><table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#ffffff">
<tr bgcolor="#FFFFFF">
<td height="35" colspan="2" align="left">◆用户注册信息(请详细填写,以获取更多优惠及新品上架信息)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="25%" height="35" align="right">用户名:</td>
<script language="JavaScript" type="text/javascript">

//校验user的弹出窗口
function check_id_window(value){
window.open("check_id.asp?username="+value,"",'toolbar=no,directories=no,scrollbars=0,resizable=1,status=no,menubar=0,width=250,height=100');
}

</script>
<td height="35" align="left"><input name="username" type="text" maxlength="20" id="username" />
<input type="button" class="c2" value="检测帐号" onClick="check_id_window(document.userinfo.username.value)" name="Check_ID"/>
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" align="right">用户密码:</td>
<td height="35" align="left"><input name="userpassword" type="password" maxlength="20" id="userpassword" />
*(6 到 20 位)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" align="right">确认密码:</td>
<td height="35" align="left"><input name="userpassword1" type="password" maxlength="20" id="userpassword1" />
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" align="right">E-mail:</td>
<td height="35" align="left"><input name="useremail" type="text" maxlength="50" id="useremail" />
*(请提供正确的地址)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" colspan="2" align="left">◇以下项目用于提示密码、帐号被盗用时验证用户合法性等。注册后不能修改!</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" align="right">密码问题:</td>
<td height="35" align="left"><input name="quesion" type="text" id="quesion" />
* </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" align="right">密码答案:</td>
<td height="35" align="left"><input name="answer" id="answer" />
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" colspan="2"><div align="center">
<input type="submit" name="Submit2" class="c2" value="提交信息" onClick="return check();"/>
<input name="Submit2" type="reset" class="c1" value="重设" />
(带<font color="#FF0000">*</font>为必填项)</div></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2"></td>
</tr>
</table></td>
</tr>
</table>
</div>
<br />
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<%case "save"%>
<!--#include file="md5.asp"-->
<%call saveuser()
end select
sub tiaoyue()
set rs=server.CreateObject("adodb.recordset")
rs.Open "select regtiaoyue from shop_config",conn,1,1
response.Write trim(rs("regtiaoyue"))
rs.Close
set rs=nothing
end sub

sub saveuser()
if trim(request("username"))="" then
response.write "<script LANGUAGE='javascript'>alert('请输入注册用户名!');history.go(-1);</script>"
response.End
elseif trim(request("userpassword"))="" then
response.write "<script LANGUAGE='javascript'>alert('请输入用户密码!');history.go(-1);</script>"
response.End
elseif trim(request("userpassword1"))="" then
response.write "<script LANGUAGE='javascript'>alert('请输入用户确认密码!');history.go(-1);</script>"
response.End
elseif trim(request("userpassword"))<>trim(request("userpassword1")) then
response.write "<script LANGUAGE='javascript'>alert('二次输入密码不一样!');history.go(-1);</script>"
response.End
elseif trim(request("useremail"))="" then
response.write "<script LANGUAGE='javascript'>alert('请填写邮箱!');history.go(-1);</script>"
response.End
elseif trim(request("quesion"))="" then
response.write "<script LANGUAGE='javascript'>alert('请填写密码问题!');history.go(-1);</script>"
response.End
elseif trim(request("answer"))="" then
response.write "<script LANGUAGE='javascript'>alert('请填写密码答案!');history.go(-1);</script>"
response.End
end If

If not Conn_bbs.Execute("Select id From [BBSXP_Users] where UserName='"&trim(request.form("username"))&"'" ).eof Then
response.write "<script LANGUAGE='javascript'>alert('用户名已存在,请重新选择!');history.go(-1);</script>"
response.end
end if

If not Conn_bbs.Execute("Select id From [BBSXP_Users] where UserMail='"&trim(request.form("useremail"))&"'" ).eof Then
response.write "<script LANGUAGE='javascript'>alert('E-Mail地址已存在,请重新选择或确认你已注册过!');history.go(-1);</script>"
response.end
end if

set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [shop_user] where useremail='"&nosql(trim(request("useremail")))&"' or username='"&nosql(trim(request("username")))&"'",conn,1,3
if rs.recordcount=0 then
rs.addnew
rs("username")=nosql(trim(request("username")))
rs("userpassword")=md5(trim(request("userpassword")))
rs("useremail")=nosql(trim(request("useremail")))
rs("quesion")=nosql(trim(request("quesion")))
rs("answer")=md5(trim(request("answer")))
rs("adddate")=now()
rs("lastlogin")=now()
rs("logins")=1
rs("zhifufangshi")=0
rs("songhuofangshi")=0
rs("reglx")=2
rs("jifen")=0
rs("jiaoyijine")=0
Rs("sex")=1
rs("yucun")=0
rs("pic")="face.gif"
rs("manbid")=0
rs("zw")="普通会员"
rs("userlastip")=Request.ServerVariables("REMOTE_ADDR")

rs.update
rs.close
set rs=nothing
set rs=conn.execute("select top 1 userid from [shop_user] order by userid desc")
userid=rs(0)
session("username")=trim(request("username"))
session("jiaoyijine")=0
session("jifen")=0
session("reglx")=1
response.Cookies("myshop").expires=date+1
session("regtimes")=1
session.Timeout=1
session("userpassword")=md5(trim(request("userpassword")))
session("manbid")=0
session("pic")="face.gif"
session("Cookies")=Cookies

set rs=server.CreateObject("adodb.recordset")
Rs.Open "select * from [BBSXP_Users]",Conn_bbs,1,3
Rs.addNew
Rs("UserName")=trim(request.form("username"))
Rs("Userpass")=MD5_bbs(trim(request.form("userpassword")))
Rs("UserMail")=trim(request.form("useremail"))
Rs("Userhome")="http://"
Rs("PasswordQuestion")= trim(request.form("quesion"))
Rs("membercode")= 1
if Request("answer")<>empty or Request("answer") <>"" then
Rs("PasswordAnswer")=MD5_bbs(trim(request.form("answer")))
end if
Rs("birthday")=birthday
Rs("Userface")="images/face/Default.gif"
Rs("UserSex")=UserSex
Rs("UserSign")=UserSign
Rs("UserMobile")=""&Request("UserMobile")&""
Rs("UserFriend")="|"
Rs("UserRegTime")=""&now()&""
Rs("UserLastIP")=Request.ServerVariables("REMOTE_ADDR")
Rs("UserLandTime")=""&now()&""
Rs("UserInfo")="\中国\\\\\\\\\\\\\"
Rs("UserIM")="\\\\\"
Rs.update
Rs.close
set Rs=nothing
Conn_bbs.execute("update [BBSXP_Statistics_Site] set TotalUser=TotalUser+1,NewUser='"&trim(request.form("username")) &"'")

set rs=server.CreateObject("adodb.recordset")
rs.Open "select mailaddress,mailusername,mailuserpass,mailname,mailsend from shop_config",conn,1,1
mailaddress=rs("mailaddress")
mailusername=rs("mailusername")
mailuserpass=rs("mailuserpass")
mailname=rs("mailname")
mailsend=rs("mailsend")
rs.close
set rs=nothing

on error resume next
'发送注册邮件
topic="您在" & webname & "的注册资料"
getpass=trim(request("userpassword"))

mailbody="<html>"
mailbody=mailbody & "<head>"
'mailbody=mailbody & "<link href="../css.css" rel="stylesheet" type="text/css">"
mailbody=mailbody & "<TABLE border=0 width='95%' align=center><TBODY><TR>"
mailbody=mailbody & "<TD valign=middle align=top>"
mailbody=mailbody & trim(request("username"))&",您好:<br><br>"
mailbody=mailbody & "欢迎您成为" & webname & "的会员,我们将提供给您最好的服务!<br>"
mailbody=mailbody & "下面是您的注册信息:<br><br>"
mailbody=mailbody & "注册名:"&trim(request("username"))&"<br>"
mailbody=mailbody & "密 码:"&getpass&"<br>"
mailbody=mailbody & "<br><br>"
mailbody=mailbody&""&webname&" ◎ 客户服务中心<br>"
mailbody=mailbody&"================================================== <br>电话:"&dianhua&"<br>"
mailbody=mailbody&"Email:"&webemail&"?<a href="&weburl&" target=_blank>"&weburl&"</a> </body></html>"

Set jmail = Server.CreateObject("JMAIL.Message") '建立发送邮件的对象
jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值
jmail.logging = true '启用邮件日志
jmail.Charset = "GB2312" '邮件的文字编码为国标
JMail.ContentType = "text/html"
jmail.FromName = mailsend '邮件发件人的地址
jmail.AddRecipient trim(request("useremail")) '邮件收件人的地址
jmail.From = mailsend '发件人的E-MAIL地址,注意:部分服务器需要把邮件地址写全
jmail.MailServerUserName = mailusername '登录邮件服务器所需的用户名,注意部分不是 ABC
jmail.MailServerPassword = mailuserpass '登录邮件服务器所需的密码
jmail.Subject = topic '邮件的标题
jmail.Body = mailbody '正文
if not jmail.Send(mailaddress) then '执行邮件发送(通过邮件服务器地址)smtp.域名.com 不一定是邮件服务器
SendMail="no"
else
SendMail="ok"
end if
if SendMail="ok" then
sendmsg="<li>您的注册信息已经发往您的邮箱,请注意查收。</li>"
else
sendmsg="<li>由于系统错误,给您发送的注册资料失败,请确认你的主机支持JMail。</li>"
end if
jmail.Close() '关闭对象
set jmail = nothing
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="100"><p>&nbsp;</p>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="80" align="left">用户注册成功<br />
<li><strong>恭喜您已注册成为[<%=webname%>]正式用户,请记好您的用户名及密码</strong></li>
<strong><br />
<%=sendmsg%> </strong>
<li><strong><a href="index.asp">返回首页</a> <a href="user.asp?action=userziliao">继续填写详细资料</a></strong></li></td>
</tr>
</table>
<p>&nbsp;</p></td>
</tr>
</table></td>
</tr>
</table>
<%else
response.write "<script LANGUAGE='javascript'>alert('对不起!您的用户名或邮箱已经被人注册!');history.go(-2);</script>"
response.End()
end if
end sub
%></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td class="dress_bottom"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
</table></td>
</tr>
</tbody>
</table>
<div><img src="img/01_bg010.gif" width="701" height="10" /></div>
<div class="left_space_head"></div></td>
</tr>
</table>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><!--#include file="bottom.asp"--></td>
</tr>
</table>
<map name="n89888_r6_c4Map"><area shape="rect" coords="195,121,282,152" href="New.asp">
</map>
</body>
</html>

搜索更多相关主题的帖子: 表单 
2007-08-25 18:26
xiaohonghui0
Rank: 1
等 级:新手上路
威 望:1
帖 子:274
专家分:0
注 册:2006-4-10
收藏
得分:0 

是什么问题你都没说,你的代码也太长了


曾用asp做过公司管理系统,新闻发布系统,个人网站之类,可代做网站 有意者请联系我,电话:13714123661
2007-08-25 19:39
sdgjsddd
Rank: 1
等 级:新手上路
帖 子:199
专家分:0
注 册:2007-6-14
收藏
得分:0 
太长了,直接说明问题,或用精简的语句来说明
2007-08-25 20:47
zxk8
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-8-4
收藏
得分:0 
就是用户注册填信息后,不能提交.每次点提交后没有任何反映,可以转到下一页.但是不能注册成功.数据库里面也没有任何注册信息!
2007-08-26 10:24
快速回复:表单提交问题
数据加载中...
 
   



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

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