大家帮着找找毛病,我晕了
下面这个页面是要在文本框中输入相关的信息,然后按“添加”按钮在数据库中增加一条新闻。但是在在填了新闻标题和路径后怎么点按钮都没有用,不知道是为什么:
<!--#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>