ASPCMS建站,前台会员注册报500错误!

h743290771 2014-04-18 05:48:53
AspCms v2.5.2 0315 前台页面注册报500错误,其他的都正常。后台注册添加的会员,前台能正常使用。就是前台填好了一点注册按钮报错!请高手指点,多谢

../member/reg.asp代码如下:

<!--#include file="../inc/AspCms_SettingClass.asp" -->
<%
dim action : action=getform("action","get")
if action = "reg" then
addUser()
elseif action = "editpass" then
editUser()
else
echoContent()
end if

Sub editPass
dim LoginName,userPass,reuserPass
LoginName=trim(session("loginName"))
userPass=getForm("userPass","post")
reuserPass=getForm("reuserPass","post")

if userPass<>reuserPass then alertMsgAndGo "两次输入密码不相同","-1"
'die "update {prefix}User set [Password]='"&md5(userPass,16)&"' where LoginName='"&LoginName&"'"
conn.Exec "update {prefix}User set [Password]='"&md5(userPass,16)&"' where LoginName='"&LoginName&"'","exe"
alertMsgAndGo "密码修改成功","editPass.asp"
End Sub

Sub editUser
dim LoginName,userPass,reuserPass,Email,Mobile,Address,PostCode,Gender,QQ,TrueName,Phone
LoginName=trim(session("loginName"))
userPass=getForm("userPass","post")
reuserPass=getForm("reuserPass","post")

Email=filterPara(getForm("Email","post"))
Mobile=filterPara(getForm("Mobile","post"))
Address=filterPara(getForm("Address","post"))
PostCode=filterPara(getForm("PostCode","post"))
Gender=filterPara(getForm("Gender","post"))
QQ=filterPara(getForm("QQ","post"))
TrueName=filterPara(getForm("TrueName","post"))
Phone=filterPara(getForm("Phone","post"))


if userPass<>reuserPass then alertMsgAndGo "两次输入密码不相同","-1"

dim passStr
if not isnul(userPass) then passStr="[Password]='"&md5(userPass,16)&"',"

'Gender="1,groupid=1"
'alertMsgAndGo Gender,""
if not isnum(Gender) then gender = 1
'alertMsgAndGo Gender,""
dim sqlsql
sqlsql = "update {prefix}User set "&passStr&" Email='"&Email&"',QQ='"&QQ&"',Mobile='"&Mobile&"',Address='"&Address&"',PostCode='"&PostCode&"',Gender="&Gender&",Phone='"&Phone&"',TrueName='"&TrueName&"' where LoginName='"&LoginName&"'"
Conn.Exec sqlsql,"exe"
'response.Write(sqlsql)
alertMsgAndGo "修改成功","editPass.asp"
End Sub

Sub echoContent()
dim templateobj,templatePath : set templateobj = new TemplateClass
templatePath=sitePath&"/"&"templates/"&setting.defaultTemplate&"/"&setting.htmlFilePath&"/reg.html"
'die templatePath
if not CheckTemplateFile(templatePath) then echo "reg.html"&err_16


with templateObj
.content=loadFile(templatePath)
.parseHtml()
.parseCommon
echo .content
end with
set templateobj =nothing : terminateAllObjects
End Sub



Sub addUser
'dim UserID,GroupID,LanguageID,SceneID,LoginName,Password,PswQuestion,PswAnswer,UserStatus,RegTime,RegIP,LastLoginIP,LastLoginTime,LoginCount,TrueName,Gender,Birthday,Country,Province,City,Address,PostCode,Phone,Mobile,Email,QQ,MSN,Permissions,AdminDesc

Dim LoginName,Password,verifyPass,Email,Mobile,Address,PostCode,Gender,QQ,UserStatus,RegTime,RegIP,LastLoginIP,LastLoginTime,Birthday,Exp1,Exp2,Exp3,GroupID,TrueName,Phone
if getForm("code","post")<>Session("Code") then alertMsgAndGo "验证码不正确","-1"

LoginName=filterPara(getForm("LoginName","post"))
Password=filterPara(getForm("userPass","post"))
verifyPass=filterPara(getForm("verifyPass","post"))
Email=filterPara(getForm("Email","post"))
Mobile=filterPara(getForm("Mobile","post"))
Address=filterPara(getForm("Address","post"))
PostCode=filterPara(getForm("PostCode","post"))
Gender=1
Gender=filterPara(getForm("Gender","post"))
QQ=filterPara(getForm("QQ","post"))
Phone=filterPara(getForm("Phone","post"))
TrueName=filterPara(getForm("TrueName","post"))

UserStatus=1
RegTime=now()
RegIP=getip()
GroupID=3


if isnul(LoginName) then alertMsgAndGo "用户名不能为空","-1"
if Conn.Exec("select count(*) from {prefix}User where LoginName='"&LoginName&"'","r1")(0) >0 then alertMsgAndGo "该用户名已被注册","-1"

if isnul(Password) then alertMsgAndGo "密码不能为空","-1"
if isnul(verifyPass) then alertMsgAndGo "确认密码不能为空","-1"
if Password<>verifyPass then alertMsgAndGo "两次输入密码不相同","-1"
if len(LoginName)>15 then alertMsgAndGo "用户名不能大于15个字符","-1"
if not IsSafeStr(LoginName) then alertMsgAndGo "您的用户名里包含了不安全字段,请重新输入","-1"
if not IsSafeStr(TrueName) then alertMsgAndGo "您的真是姓名里包含了不安全字段,请重新输入","-1"
if len(TrueName)>5 then alertMsgAndGo "真实姓名不能大于5个字符,如真实姓名超过5个字符的用户,请联系网站管理员!","-1"
if not isnul(Mobile) then
if not CheckMobile(Mobile) then alertMsgAndGo "您输入的手机号码格式不正确,请重新输入","-1"
end if
if not isnul(Phone) then
if not CheckTelPhone(Phone) then alertMsgAndGo "您输入的电话号码格式不正确,请重新输入","-1"
end if
if not isnul(Email) then
if not CheckEmail(Email) then alertMsgAndGo "您输入的邮箱格式不正确,请重新输入","-1"
end if
if not isnul(QQ) then
if not CheckQQnum(QQ) then alertMsgAndGo "您输入的QQ格式不正确,请重新输入","-1"
end if
if not isnul(Address) then
if not IsSafeStr(Address) then alertMsgAndGo "您输入的地址里面含有不安全字段,请检查并且重新输入","-1"
end if
if not isnul(PostCode) then
if not CheckCdoe(PostCode) then alertMsgAndGo "您输入的邮政编码格式不正确,请重新输入","-1"
end if
Password=md5(Password,16)
Conn.Exec"insert into {prefix}User(LoginName,[Password],Email,Mobile,Address,PostCode,Gender,QQ,UserStatus,RegIP,RegTime,GroupID,TrueName,Phone) values('"&LoginName&"','"&Password&"','"&Email&"','"&Mobile&"','"&Address&"','"&PostCode&"',"&Gender&",'"&QQ&"',"&UserStatus&",'"®IP&"','"®Time&"',"&GroupID&",'"&TrueName&"','"&Phone&"')","exe"

alertMsgAndGo "注册成功!",sitePath&setting.languagepath&"member/login.asp"
End Sub
%>

../inc/AspCms_SettingClass.asp代码如下:
<!--#include file="AspCms_MainClass.asp" -->
<%
if siteMode=0 then die siteHelp
dim LanguageAlias : LanguageAlias=""
dim setting : set setting=new SettingClass
%>
<!--#include file="AspCms_Language.asp" -->

reg.htm代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户注册 -{aspcms:sitetitle}- Powered by ASPCMS V2</title>
<meta name="Keywords" content="{aspcms:sortkeyword}" >
<meta name="Description" content="{aspcms:sortdesc}" >
<meta name="generator" content="ASPCMS! V2" />
<meta name="author" content="ASPCMS! Team and Chancoo UI Team" />
<meta name="copyright" content="2006-2013 Chancoo Inc." />
<link type="text/css" href="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/css/public.css" rel="stylesheet" />
<link type="text/css" href="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/css/front.css" rel="stylesheet" />
<script type="text/javascript" src="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/js/jquery1.4.2.js"></script>
<script type="text/javascript" src="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/js/front.js"></script>
<script type="text/javascript" src="{aspcms:sitepath}/Templates/{aspcms:defaulttemplate}/js/productlist_roll.js"></script>

</head>

<body>
{aspcms:top}

<div class="wrap list_wrap singel_wrap">
{aspcms:template src=left1.html}

<div class="column_m">
<div class="bt">
<h4>用户注册</h4><span>您现在的位置:<a href="{aspcms:sitepath}{aspcms:languagepath}">首页</a> > 用户注册 </span>
</div>
<div class="nr">

<div class="nr_text"><form method="post" name="" action="?action=reg">
<table border="0" cellpadding="2" cellspacing="0" align="center" width="80%" style="margin-top:20px;">
<tr>
<td width="20%" height="28">用户名:</td>
<td width="80%"><input type="text" name="LoginName" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">密 码:</td>
<td><input type="password" name="userPass" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">确认密码:</td>
<td><input type="password" name="verifyPass" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">真实姓名:</td>
<td><input type="text" name="TrueName" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">性别:</td>
<td>
<input type="radio" value="1" name="Gender" checked />男
<input type="radio" value="0" name="Gender" />女
</td>
</tr>
<tr>
<td height="28">联系电话:</td>
<td><input type="text" name="Phone" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">手机:</td>
<td><input type="text" name="Mobile" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">邮箱:</td>
<td><input type="text" name="Email" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">QQ:</td>
<td><input type="text" name="QQ" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">地址:</td>
<td><input type="text" name="Address" style="BORDER: #B7DAEF 1px solid;WIDTH: 300px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">邮政编码:</td>
<td><input type="text" name="PostCode" style="BORDER: #B7DAEF 1px solid;WIDTH: 150px; height:18px;" size=16 maxlength="50" /></td>
</tr>
<tr>
<td height="28">验证码:</td>
<td><input type="text" name="code" style="BORDER: #B7DAEF 1px solid;WIDTH: 50px; height:18px;" size=10 maxlength="4" /><a onClick="SeedImg.src='/{aspcms:sitepath}inc/checkcode.asp'"><img src="/{aspcms:sitepath}inc/checkcode.asp" id="SeedImg" align="absmiddle" style="cursor:pointer;" border="0" /></a></td>
</tr>
<tr>
<td height="28"></td>
<td><input type="submit" name="Submit" value="注册" style="BORDER: #B7DAEF 1px solid;color:#0099ff" /> <input type="button" value="登陆" style="BORDER: #B7DAEF 1px solid;color:#0099ff" onclick="location.href='{aspcms:sitepath}{aspcms:languagepath}member/login.asp'" /></td>
</tr>
</table>
</form>

</div>
</div>
</div>
<div class="clearboth"></div>
</div>

{aspcms:foot}
</body>
</html>
...全文
5948 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
h743290771 2014-04-21
  • 打赏
  • 举报
回复
按照1楼的方法,找到问题了,解决了~多谢!
redcn2004 2014-04-19
  • 打赏
  • 举报
回复
一般500错误,按照楼上的办法来处理。应该不是代码问题
孟子E章 2014-04-19
  • 打赏
  • 举报
回复
打开iis详细错误提示信息发送到客户端 ie里面高级选项里面,去掉“显示友好HTTP错误信息”

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧