隐藏表单的问题?

sswalloww 2004-12-02 10:18:21
<html>
<head><title>error</title></head>
<body>
<center><%=error%></center>
<form method="post" action="reg.asp">
<% for each item in request.form %>
<input name="<%=item%>" type="hidden" value="<%=server.HTMLEncode(request.form(item))%>">
<%next%>
</form>
</body>
</html>

为何显示时文本框的内容还是没有返回啊?
...全文
73 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
sswalloww 2004-12-03
就是在遗漏一个文本框没填时 返回的表单内容没有全被清除掉
回复
yqh1314 2004-12-03
你想实现的是什么呢!
回复
sswalloww 2004-12-03
<!--#include file="conn.asp"-->
<!--#include file="reg.asp"-->

<%
sub errorForm(error)
%>

<html>
<head><title>error</title></head>
<body>
<center><%=error%></center>
<form method="post" action="reg.asp">
<% for each item in request.form %>
<input name="<%=item%>" type="hidden" value="<%=server.HTMLEncode(request.form(item))%>">
<%next%>
</form>
</body>
</html>

<%
response.end
end sub
%>

<%
'check for valid syntax in an email address.


function Checkemail(u_email)

dim names,name,i,c
Checkemail=true
names=Split(u_email,"@")
if UBound(names)<>1 then
Checkemail=false
exit function
end if

for each name in names
if Len(name)<=0 then
Checkemail=false
exit function
end if
for i=1 to Len(name)
c=Lcase(Mid(name,i,1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.",c)<=0 and not IsNumeric(c) then
Checkemail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
Checkemail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
Checkemail = false
exit function
end if

i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
Checkemail= false
exit function
end if

if InStr(email, "..") > 0 then
Checkemail= false
end if

end function


'check the values

dim user_name,user_pwd1,user_pwd2,user_email,user_add,user_tel,uesr_postcode,uesr_realname

if trim(request("u_name"))="" then
errorForm "用户名不能为空!"
founderr=ture
else
user_name=trim(request("u_name"))
end if


if trim(request("u_pwd1"))="" or trim(request("u_pwd2"))="" then
errorForm "密码或确认密码不能为空!"
founderr=ture
else
user_pwd1=trim(request("u_pwd1"))
user_pwd2=trim(request("u_pwd2"))
end if

if user_pwd1 <> user_pwd2 then
errorForm "密码和确认密码不一致!"
founderr=ture
end if


if Checkemail(trim(request("u_email")))=false then
errorForm "你的E-mail有错误!"
founderr=ture
else
user_email=trim(request("u_email"))
end if


if request("u_tel")="" then
errorForm "电话不能为空!"
founderr=ture
elseif not IsNumeric(request("u_tel")) then
errorForm"电话请输入数字!"
founderr=ture
else
user_tel=request("u_tel")
end if


if request("u_address")="" then
errorForm "地址不能为空!"
founderr=ture
else
user_add=request("u_address")
end if



if request("u_postcode")="" then
errorForm "邮编不能为空!"
founderr=ture
elseif not IsNumeric(request("u_postcode")) then
errorForm "邮编请输入数字!"
founderr=ture
else
user_postcode=request("u_postcode")
end if

if request("u_realname")="" then
errorForm "请填入真实姓名!"
founderr=ture
else
user_realname=request("u_realname")
end if

set rs=server.createobject("adodb.recordset")
rs.ActiveConnection=conn

sql="select * from users where user_name='"&user_name&"'"
rs.open sql,conn,3,3

if not rs.eof then
errorForm "用户名已被注册!"
founderr=ture
end if



rs.close
%>

<% set rs=server.createobject("adodb.recordset")
rs.ActiveConnection=conn

if founderr=false then

sql="select * from users where user_name='"&user_name&"'"
rs.open sql,conn,3,3
rs.addnew
rs("user_name")=user_name
rs("user_pwd")=user_pwd1
rs("user_add")=user_add
rs("user_email")=user_email
rs("user_tel")=user_tel
rs("user_regtime")=time()
rs("user_ip")=request.servervariables("remote_addr")
rs("user_postcode")=user_postcode
rs("user_realname")=user_realname
rs.update
rs.close
end if
%>


<html>
<meta http-equiv="refresh" content="2;url=index.asp">
<head><title>注册成功 </title></head>
<body>
<center>
注册成功,请登陆!^_^
</center>
</body>
</html>

这是我的处理页面 帮我看看啊!

回复
redpark 2004-12-02
这个没问题
问题在于你的处理页面
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-12-02 10:18
社区公告
暂无公告