大家帮着找找毛病,我晕了

gbhsky 2010-04-06 12:32:19
下面这个页面是要在文本框中输入相关的信息,然后按“添加”按钮在数据库中增加一条新闻。但是在在填了新闻标题和路径后怎么点按钮都没有用,不知道是为什么:

<!--#include file="include/conn.inc"-->
<%
if isempty(session("uid")) then
response.redirect("login.asp")
end if

set rs=Server.CreateObject("ADODB.RecordSet")

response.write(request("txtTitle"))

'if Request.ServerVariables("REQUEST_METHOD") = "POST" then '如果是post回来的刷新则为添加新闻

if request("txtTitle")<>"" then
sql="select max(id) as maxid from news"
rs.open sql,conn,1,1
maxid=rs("maxid")+1
sql="insert into news(id,title,path)values("&maxid&",'"&request("txtTitle")&"','"&request("flePath")&"')"
conn.execute sql
response.redirect("newsmanage.asp")
end if

%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加新闻</title>
</head>

<body>

<div align="center">
<table border="0" width="800" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td>
<iframe id="IFrame1" marginWidth="0" marginHeight="0" frameBorder="0" width="800" scrolling="no" allowTransparency src="images/index_top.htm" name="I1">
</iframe>
</td>
</tr>
<tr>
<td height="230" align="center" valign="top">
<form method="POST" action="self">

<p align="left">

<font size="2" color="#008080"><b>添加新闻</b></font><br>
<hr color="#008080" align="left" width="89%" size="1">


</p>


<p> </p>

<table border="1" width="59%" cellspacing="0" cellpadding="0" id="table2" height="94" style="border-collapse: collapse" bordercolor="#008080">
<tr>
<td height="28" width="16%">
<font size="2">新闻标题</font></td>
<td height="28" width="83%">

<input type='text' name='txtTitle' size='54'></td>
</tr>
<tr>
<td height="27" width="16%">
<font size="2">新闻文件</font></td>
<td height="27" width="83%">
<input type='file' name='flePath' size='44'></td>
</tr>
<tr>
<td height="37" colspan="2">
<p align="center"><button name="btnsubmit">添  加</button>  </td>
</tr>

</table>
</form>
</td>
</tr>
<tr>
<td>
<iframe marginWidth="0" marginHeight="0" frameBorder="0" noResize width="100%" scrolling="no" height="62" allowTransparency src="images/index_bottom.htm">
</iframe></td>
</tr>
</table>
</div>

</body>

</html>
...全文
62 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dogfish 2010-04-06
  • 打赏
  • 举报
回复
你的button只是一个按钮,没有提交的作用。

<input type="submit">
OnceMyselfMonkey 2010-04-06
  • 打赏
  • 举报
回复
按钮

<p align="center"><button name="btnsubmit">添  加</button>

换成

<input type="submit" name="Submit" value="添加">

yan11cn 2010-04-06
  • 打赏
  • 举报
回复
never exists 2010-04-06
  • 打赏
  • 举报
回复
<button name="btnsubmit" type="submit">

28,390

社区成员

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

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