日期:2014-05-16  浏览次数:21179 次

求助!求助!提交出错
各位大神,下面是用ASP写的一个网页,调用FCK文本编辑框,点击提交按钮将文本编辑框里的内容保存到数据库database.mdb。点击读数据可以读出数据库里的内容到页面。可是为啥第一次运行这个页面点击提交总是出错,说找不到页面,点击读数据后,再写数据提交就不会出错啊?求大神帮帮忙啊!困扰好久了啊!感谢感谢!

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script> <!--fck编辑器加在<head>中的代码-->

</head>
<!--#include file="inc_/conn.asp"-->
<%
if request("submit")="OK" then
content=request("content")
sql="insert into content (content) values('"&content&"')"
set rs=conn.execute(sql)
 response.write"<SCRIPT language=JavaScript>alert('写入成功');"
 response.write"this.location.href='javascript:history.back();'</SCRIPT>" 
end if
%>
<body>
<form action="?submit=OK" method="post">
<table border="1">
  <tr>
    <td rowspan="2" valign="top"><a href="index.asp">写数据</a>:<br /><a href="show.asp">读数据</a>:</td>
    <td width="480" height="430" valign="top">
<p><!--fck编辑器加在<form>中的<script>代码-->
<script type="text/javascript"> 
var oFCKeditor = new FCKeditor( 'content' ) ; 
oFCKeditor.Height = "420"
oFCKeditor.Create() ; 
   </script> 
 </td>
  </tr>
  <tr>
    <td><input type="submit" value="提交"/>
</td>
  </tr>
</table>
</form>
</body>
</html>

------解决方案--------------------
<form action="?submit=OK" method="post">,对应的显示页面了?
改成这样:
<form action="b.asp" submit=OK" method="post">
然后在写一个b.asp,这个页面就是用来显示数据库数据的!!
------解决方案--------------------

if request("submit")="OK" then
改成
if request.querystring("submit")="OK" then
------解决方案--------------------
<%
 if request("submit")="OK" then
 content=request("content")
 sql="insert into content (content) values('"&content&"')"
 set rs=conn.execute(sql)
  response.write"<SCRIPT language=JavaScript>alert('写入成功');"
  response.write"this.location.href='javascript:history.back();'</SCRIPT>" 
 end if
 %>
这一段改成

<%
 if request.querystring("submit")="OK" then
 content=request("content")
 sql="insert into [content] ([content]) values('"&content&"')"
 conn.execute(sql)
  response.write"<SCRIPT language=JavaScript>alert('写入成功');</script>"
 end if
 %>

------解决方案--------------------
<%
if request("submit")="OK" then