找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 151|回复: 9

请问一下,为何页面跳转时,数据不保存到数据库

[复制链接]
发表于 2010-1-18 02:54:30 | 显示全部楼层 |阅读模式 IP:江苏扬州
请问一下,为何页面转到2.asp时,数据不保存到数据库?页面直接就转过去了,没有先把数据保存这一环结.看了好几天都没看出来.有高手知道吗?小弟在这里先谢谢了 <!--#include file="conn.asp"--> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> </head> <body> <% set rs=server.createobject("adodb.recordset") sql="select * from qiyebiao where id="&request("id") rs.open sql,conn,3,3 if rs.eof then '如果数据库中没有这条记录,说明调用有错 response.write"调用数据出错" response.end '结束以下的语句的执行 end if radio=Request.Form("radio") if radio="2" then zhuangtai=2 sql="update qiyebiao set zhuangtai='"&zhuangtai&"' where id="&request("id") conn.Execute(sql) else beizhu=Request.Form("textarea") sql="update qiyebiao set beizhu='"&beizhu&"' where id="&request("id") conn.Execute(sql) end if %> <table width="615" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4"><div align="center">待审查企业基本信息</div></td> </tr> <tr> <td width="91">企业名称</td> <td width="216"><%=rs("name")%></td> <td width="90">企业地址</td> <td width="200"><%=rs("dizhi")%></td> </tr> <tr> <td>联系电话</td> <td><%=rs("dianhua")%></td> <td>企业法人</td> <td><%=rs("boss")%></td> </tr> <tr> <td>行业分类</td> <td colspan="3"><%=rs("kind")%></td> </tr> </table> <form name="form5" method="post" action="2.asp"> <table width="500" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="615" border="0" align="center"> <tr> <td colspan="4"><div align="center">审查情况</div></td> </tr> <tr> <td width="159"><div align="center" >通过审查</div></td> <td width="146"> <input type="radio" name="radio" value="2"> </td> <td width="154"><div align="center">未能通过</div></td> <td width="138"> <input type="radio" name="radio" value="1"> </td> </tr> <tr> <td><div align="center">未通过原因</div></td> <td colspan="3"> <textarea name="textarea" cols="50" rows="5">如果未能通过,须在此填如原因</textarea> </td> </tr> <tr> <td>&nbsp;</td> <td> <input type="submit" name="Submit" value="提交"> </td> <td> <input type="reset" name="Submit2" value="重置"> </td> <td>&nbsp;</td> </tr> </table></td> </tr> </table> </form> <p>&nbsp;</p> </body> </html>
发表于 2010-1-18 02:54:34 | 显示全部楼层 IP:江苏扬州
这个文件叫2.ASP吗?
回复

使用道具 举报

发表于 2010-1-18 02:54:38 | 显示全部楼层 IP:江苏扬州
<form name="form5" method="post" action="2.asp"> 不是,是要转到2.asp的,我试过去掉跳转就没问题<form name="form5" method="post" action="">
回复

使用道具 举报

发表于 2010-1-18 02:54:42 | 显示全部楼层 IP:江苏扬州
问题可能在2.asp里..
回复

使用道具 举报

发表于 2010-1-18 02:54:46 | 显示全部楼层 IP:江苏扬州
怎么会这样?我以为是语句错误,版主能帮我看看吗?这是2.asp的代码,提交修改后转到上面的页面 <!--#include file="conn.asp"--> <html> <head> <title>无标题文档</title> </head> <body> <table width="500" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="53"><div align="center">序号</div></td> <td width="436"><div align="center">待审查企业名单</div></td> </tr> </table> <table width="500" border="1" align="center" cellpadding="0" cellspacing="0"> <% set rs=server.createobject("adodb.recordset") rs.open "select * from qiyebiao where zhuangtai='1' order by zhuangtai desc",conn,1,1 if not rs.eof then '把所有的记录调出来 do while not rs.eof %> <tr> <td width="53"><div align="center"><%=rs("ID")%> </div></td> <td width="367"><div align="center"><%=rs("name")%></div></td> <td width="72"><div align="center"><a href="daishenxg.asp?id=<%=rs("id")%>">修改</a></div></td> </tr> <% rs.movenext loop '循环结束 %> </table> </body> </html> <% end if rs.close set rs=nothing conn.close set conn=nothing %>
回复

使用道具 举报

发表于 2010-1-18 02:54:50 | 显示全部楼层 IP:江苏扬州
<!--#include file="conn.asp"--> <% set rs=server.createobject("adodb.recordset") sql="select * from qiyebiao where id="&request("id") rs.open sql,conn,3,3 if rs.eof then '如果数据库中没有这条记录,说明调用有错 response.write "<script>alert('非法数据提交!');history.go(-1)</script>" response.end '结束以下的语句的执行 end if radio=Request.Form("radio") if radio="2" then zhuangtai=2 sql="update qiyebiao set zhuangtai='"&zhuangtai&"' where id="&request("id") conn.Execute(sql) else beizhu=Request.Form("textarea") sql="update qiyebiao set beizhu='"&beizhu&"' where id="&request("id") conn.Execute(sql) end if response.Redirect("2.asp")%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> </head> <body> …… <form name="form5" method="post" action=""> ……
回复

使用道具 举报

发表于 2010-1-18 02:54:54 | 显示全部楼层 IP:江苏扬州
你把信息提交给2.asp 原来存数据的页面程序没被执行
回复

使用道具 举报

发表于 2010-1-18 02:54:59 | 显示全部楼层 IP:江苏扬州
一会帮你看..
回复

使用道具 举报

发表于 2010-1-18 02:55:03 | 显示全部楼层 IP:江苏扬州
islet,我加了你的代码后就进不了2.asp页面了,似乎是直接运行了response.Redirect("2.asp") 是不是要加Resonse.Buffer=True和Response.Flush啊?但是我加了还是进不去
回复

使用道具 举报

发表于 2010-1-18 02:55:07 | 显示全部楼层 IP:江苏扬州
谢谢大家,原因我已经找出来了if radio="2" then...else好像是默认radio就等于1,value换成radio1,radio2就行了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 11:22 , Processed in 0.244832 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表