注册 登录
编程论坛 ASP技术论坛

帮忙解决发布信息问题

l520jia 发布于 2008-08-13 11:10, 807 次点击
就是再添加页添加完成时,提交后仍返回当前页,而且显示页没有显示刚添加完的信息。怎么回事啊?form 表单提交给postexpo.jsp?action=add 方法是post
9 回复
#2
l520jia2008-08-13 11:12
我是新手,刚进来,希望大家多多指教。我对asp懂得不是特深
#3
yms1232008-08-13 11:13
代码是怎么写的?
#4
jiazhoutong2008-08-13 11:20
帮帮我
谁能告诉我,网上文件签收程序,万分感谢
#5
l520jia2008-08-13 11:20
<%
response.write"<br>"
if request("action") ="add" then
call post()
end if
response.write"<br>"
%>
 
处理过程
<%
sub post()
if Replace_Text(request.form("title"))="" then
response.write "<li>没有填写展会名称</li>"
founderr=true
end if

if Replace_Text(request.form("title"))>"" then
title=Replace_Text(request.form("title"))
sql="select id from expo where title='"&title&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not (rs.Bof and rs.eof) then
response.write"<li>此展会名称已经存在,请重新设置</li>"
founderr=true
end if
end if


if Replace_Text(request.form("holdCountry"))="" then
response.write "<li>没有填写举办国家</li>"
founderr=true
end if

if Replace_Text(request.form("beginDate"))="" then
response.write "<li>没有填写参展开始日期</li>"
founderr=true
end if

if Replace_Text(request.form("endDate"))="" then
response.write "<li>没有填写参展结束日期</li>"
founderr=true
end if

if Replace_Text(request.form("expireDate"))="" then
response.write "<li>没有填写报名截止日期</li>"
founderr=true
end if

if Replace_Text(request.form("place"))="" then
response.write "<li>参展地(展馆)</li>"
founderr=true
end if

if Replace_Text(request.form("frontFor"))="" then
response.write "<li>没有填写主办单位</li>"
founderr=true
end if

if Replace_Text(request.form("brief"))="" then
response.write "<li>没有填写展会简介</li>"
founderr=true
end if

if Replace_Text(request.form("product"))="" then
response.write "<li>没有填写参展范围</li>"
founderr=true
end if

if Replace_Text(request.form("linkman"))="" then
response.write "<li>没有填写联系人</li>"
founderr=true
end if

if Replace_Text(request.form("country1"))="中国" then
if Replace_Text(request.form("province"))=""  or Replace_Text(request.form("city"))="" then
response.write "<li>国家如果选择了中国,必须选择地级市和市、县</li>"
founderr=true
end if
end if

if Replace_Text(request.form("address"))="" then
response.write "<li>没有填写联系地址</li>"
founderr=true
end if

if Replace_Text(request.form("phone"))="" then
response.write "<li>没有填写固定电话</li>"
founderr=true
end if

if founderr=false then
'开始存储数据
title=Replace_Text(request.form("title"))

sql="select * from expo where title='"&title&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not (rs.Bof and rs.eof) then
response.write"<li>此展会名称已经存在,请重新设置</li>"
else
rs.addnew
rs("brief")=Replace_Text(request.form("brief"))
rs("city")=Replace_Text(request.form("city"))
rs("aidance")=Replace_Text(request.form("aidance"))
rs("province")=Replace_Text(request.form("province"))
rs("title")=Replace_Text(request.form("title"))
rs("company")=Replace_Text(request.form("company"))
rs("address")=Replace_Text(request.form("address"))
rs("beginDate")=Replace_Text(request.form("beginDate"))
rs("endDate")=Replace_Text(request.form("endDate"))
rs("activity")=Replace_Text(request.form("activity"))
rs("fax")=Replace_Text(request.form("fax"))
rs("mobile")=Replace_Text(request.form("mobile"))
rs("holdCountry")=Replace_Text(request.form("holdCountry"))
rs("undertake")=Replace_Text(request.form("undertake"))
rs("zip")=Replace_Text(request.form("zip"))
rs("expireDate")=Replace_Text(request.form("expireDate"))
rs("place")=Replace_Text(request.form("place"))
rs("linkman")=Replace_Text(request.form("linkman"))
rs("phone")=Replace_Text(request.form("phone"))
rs("homepage")=Replace_Text(request.form("homepage"))
rs("authorize")=Replace_Text(request.form("authorize"))
rs("charge")=Replace_Text(request.form("charge"))
rs("email")=Replace_Text(request.form("email"))
rs("frontFor")=Replace_Text(request.form("frontFor"))
rs("product")=Replace_Text(request.form("product"))
rs("country1")=Replace_Text(request.form("country1"))
rs("sh")=Replace_Text(request.form("sh"))
if Replace_Text(request.form("pic_on"))=1 then
rs("picture")=Replace_Text(request.form("picture"))
end if
rs("dateandtime")=now()
rs.update
response.redirect ("expo.jsp?pass=1")
end if
end if
end sub
%>
#6
l520jia2008-08-13 11:24
之前用都是可以的 最近添加就不可以了 希望ysm123版主帮我看看 十分感谢
#7
l520jia2008-08-13 11:28
对了 调用的conn 呈灰色显示 和它有关吗?
#8
yms1232008-08-13 14:35
用的是什么数据库?
#9
hikor2008-08-13 15:16
你是怎么让你的数据显示的 代码怎么写的 可能就是那出了问题
#10
l520jia2008-08-13 15:24
是sql server 2000数据库 企业版的,不好意思,由于刚开始这样的工作有点忙。刚才着急就没在
1