| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 865 人关注过本帖
标题:表单提交后没有页面任何反馈结果,数据插入不进去
取消只看楼主 加入收藏
在编程中沦落
Rank: 2
等 级:新手上路
威 望:4
帖 子:411
专家分:0
注 册:2005-12-25
收藏
 问题点数:0 回复次数:1 
表单提交后没有页面任何反馈结果,数据插入不进去

一个注册表单,提交后页面一片空白,以下是保存表单的代码,弄不明白哪里有错,以前都正常的啊,可能后来不小心改了哪里就不正常了现在,找不出原因,哪个细心的同志帮帮忙啊……,谢谢!
ie的状态栏左下角错误提示说行一缺少对象,晕,缺少con2.asp文件吗?不可能,以下是con2.asp文件代码……
<%
set conn=server.createobject("adodb.connection")
connstr="Provider=Microsoft.jet.oledb.4.0; data Source="&server.mappath("../web/data/data.mdb")
conn.open connstr
%>

下面是save.asp文件的所有代码,所说的缺少对象就是下面这些代码的第一行吧?

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

<%
name=replace(trim(request.form("name")),"'","")
sex=replace(trim(request.form("sex")),"'","")
pass=replace(trim(request.form("pass")),"'","")
pass2=replace(trim(request.form("pass2")),"'","")
jclass=replace(trim(request.form("jclass")),"'","")
Xming=replace(trim(request.form("Xming")),"'","")
mail=replace(trim(request.form("mail")),"'","")
post=replace(trim(request.form("post")),"'","'")
tel=replace(trim(request.form("tel")),"'","")
mob=replace(trim(request.form("mob")),"'","")
add=replace(trim(request.form("add")),"'","")
inc=replace(trim(request.form("inc")),"'","")
adddate=replace(trim(request.form("adddate")),"'","")
ask=replace(trim(request.form("ask")),"'","")
question=replace(trim(request.form("question")),"'","")


if name="" then
response.write "<SCRIPT language=JavaScript>alert('请输入用户名,用户名不能为空');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if


if jclass="n" then
response.Write"<SCRIPT language=JavaScript>alert('请正确选择您的会员类型');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if

if jclass=1 then
if inc="" then
response.write "<Script language=JavaScript>Alert('您选择的是企业会员,公司名称不能为空');"
Response.write "this.location.href='vbscript:history.back()';</Script>"
Response.End
end if
end if

if pass="" or len(pass)>16 or len(pass)<6 then
response.write "<SCRIPT language=JavaScript>alert('密码长度为6-16个字符');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if

if pass2="" then
response.write "<SCRIPT language=JavaScript>alert('确认密码不能为空');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
else
if pass<>pass2 then
response.write "<SCRIPT language=JavaScript>alert('密码和确认密码不一致');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
end if


if not(isnumeric(mob)) then
response.write "<SCRIPT language=JavaScript>alert('手机号码必须是数字');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if


if ask="" then
response.write "<SCRIPT language=JavaScript>alert('密码提示问题不能为空');"
Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if

if question="" then
response.write "<SCRIPT language=JavaScript>alert('取回密码答案不能为空!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if

%>

<%'===============================验证是否有重复申请(开始)===============
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Member where name='"&LCase(trim(request.form("name")))&"'" ,conn,1,1
'LCase(String) 用来把所有编号转换成小写并验证是否重复,防止大小写编码用户共存!
if rs.recordcount>0 then
response.write "<script language=javascript>"
response.write "alert('对不起,已经有此用户名,请重新输入!');"
response.write "this.location.href='vbscript:history.back()';</script>"
Response.end
else


'========================验证是否有重复申请(结束)以下是将表单的内容插入到数据库中============================
set rs=server.createobject("adodb.recordset")
sql="select * from Member"
rs.open sql,conn,1,3
rs.addnew
name=request.form("name")
sex=request.form("sex")
jclass=request.form("jclass")
pass=request.form("pass")
Xming=request.form("Xming")
post=request.form("post")
fax=request.form("fax")
tel=request.form("tel")
mob=request.form("mob")
mail=request.form("mail")
add=request.form("add")
inc=request.form("inc")
ask=request.form("ask")
question=request.form("question")

rs("name")=name
rs("sex")=sex
rs("pass")=pass
rs("jclass")=jclass
rs("Xming")=Xming
rs("post")=post
rs("tel")=tel
rs("mob")=mob
rs("fax")=fax
rs("mail")=mail
rs("add")=add
rs("inc")=inc
rs("ask")=ask
rs("question")=question
rs("regip")=request.servervariables("remote_addr")'记录注册ip
rs("regtime")=date()'=在数据库里插入当前的时间,格式为年,月,日
if jclass=1 then
rs("incuser")=1
else rs("incuser")=0
end if

rs.update
rs.close
conn.close
set rs=nothing
end if

'===========================================插入结束=============================
%>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
-->
</style></head>
<body>
<div align="center">
<p>恭喜!注册成功</p>
<p><input name="retun" type="button" onClick="javascript:window.history.go(-1)" value="返回" size="3"></p>
</div>
</body>
</html>

[此贴子已经被作者于2006-7-17 20:51:54编辑过]

搜索更多相关主题的帖子: 表单 数据 页面 结果 
2006-07-17 20:47
在编程中沦落
Rank: 2
等 级:新手上路
威 望:4
帖 子:411
专家分:0
注 册:2005-12-25
收藏
得分:0 

数据是没有插入进数据库中的……

我实在没法了……

今天测试又行了啊……不用去掉“显示有好的HTTP错误”都行,都能插入到数据库中……

昨天我怎么测试都不行,真是弄不明白怎么回事,我后来也没改过程序,妈的,邪门……


2006-07-18 10:22
快速回复:表单提交后没有页面任何反馈结果,数据插入不进去
数据加载中...
 
   



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

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