为何数据提交不了?

freeness 2004-02-03 03:53:16
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/conn.asp" -->
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
Session.Contents.Remove("MM_Username")
Session.Contents.Remove("MM_UserAuthorization")
MM_logoutRedirectPage = "login.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow") Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<a href="add_wen.asp">添加文章</a>   <a href="del_wen.asp">删除文章</a>  <a href="<%= MM_Logout %>">退出登陆</a>
<%
if request("title") <> empty and request("s1") <> empty then
Set myconn = Server.CreateObject("adodb.connection")
myconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("../../db/netbar.asp")
title2 = replace(replace(trim(Request("title")),vbcrlf,"<br>")," "," ")
r12 = request("r1")
s12 = replace(replace(trim(Request("s1")),vbcrlf,"<br>")," "," ")
s22 = replace(replace(trim(Request("s2")),vbcrlf,"<br>")," "," ")
if s22 = empty then
s22 = " "
end if
mysql = "insert into wen (类别,标题,说明,内容,添加时间) values ('"&r12&"','"&title2&"','"&s22&"','"&s12&"','"&now()&"')"
'response.write mysql
myconn.execute mysql
response.write "<a href = 'add_wen.asp'>添加成功,返回</a>"
else
%>

<div align="center">
<center>
<form action = "add_wen.asp" name = "form" method = "post">
<table border="0" width="100%">
<tr>
<td width="14%">

<p align="center">标题:</p>
</td>
<td width="86%"><input type = "text" name = "title" size="55"></td>
</tr>
<tr>
<td width="14%">
<p align="center">类型:</p>
</td>
<td width="86%">


<p><input type="radio" value="动态" checked name="R1">网吧动态
<input type="radio" value="技术" name="R1">技术支持
<input type="radio" value="软件" name="R1">相关软件
<input type="radio" value="资费" name="R1">资费标准 <br>
<input type="radio" value="法律" name="R1">法律法规
<input type="radio" value="宝典" name="R1">网吧宝典
<input type="radio" value="公告" name="R1">公告
</p>

</td>
</tr>
<tr><td>说明:</td><td><p><textarea rows="8" name="S2" cols="54"></textarea></p></td></tr>
<tr>
<td width="14%">
<p align="center">内容:</p>
软件的内容为链接地址
</td>
<td width="86%">

<p><textarea rows="8" name="S1" cols="54"></textarea></p>

<p> </td>
</tr>
<tr>
<td width="14%"></td>
<td width="86%"><input type = submit>      <input type = reset></td>
</tr>
</table> </form>
</center>
</div>
<%end if%>
...全文
79 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
freeness 2004-02-03
  • 打赏
  • 举报
回复
是当前页面啊,以前提交成功都有个 添加成功,返回 的连接的
SDQDboy 2004-02-03
  • 打赏
  • 举报
回复
如果是数据库中写不进数据的话,那你仔细检查一下你的字段类型是否相同,数据库的的字段长度是否够用
wozhenbei 2004-02-03
  • 打赏
  • 举报
回复
没有错误啊
SDQDboy 2004-02-03
  • 打赏
  • 举报
回复
既然没有错误提示那么 <form action = "add_wen.asp" name = "form" method = "post">
看一下是不是 action = "add_wen.asp" 这里转向的页面是不是当前页面啊!
TrueAndFalse 2004-02-03
  • 打赏
  • 举报
回复
你是用DW生成的代码吧,建议还是手工写吧
DW太乱了
ygghost 2004-02-03
  • 打赏
  • 举报
回复
我怎么没看到提交的按扭???
freeness 2004-02-03
  • 打赏
  • 举报
回复
没报错,提交后就跟页面刷新了一样。。。
stefli 2004-02-03
  • 打赏
  • 举报
回复
<%@LANGUAGE="VBSCRIPT"%>
修改一下,留个空白
<%@ LANGUAGE="VBSCRIPT"%>
有没有报错哦?

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧