求教高手,帮忙看看这个页面点“顶”和“踩”数据库字段值不会变化
<!--#include file="pysjzx_conn.asp"--><!--#include file="webconfig.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=cf("webname")%>-建议留言</title>
<meta content="<%=keyword%>" name="keywords">
<meta content="<%=description%>" name="description">
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<!--#include file="webhead.asp"-->
<%
dim id,action,ok
ok=request("ok")
id=lcase(trim(request("id")))
action=request.QueryString("action")
if IsNumeric(request.QueryString("id"))=False or request.QueryString("id")="" then
response.write"<SCRIPT language=JavaScript>alert('参数错误2!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
sql="select * from gustbook,gustback where id="&id&" and id=parantid"
Set rsb= Server.CreateObject("ADODB.Recordset")
rsb.open sql,conn,1,1
if rsb.bof and rsb.eof then
response.write"<SCRIPT language=JavaScript>alert('参数错误1!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
rsb("countss")=rsb("countss")+1
rsb.update
end if
if ok<>"" then
sql2="select * from gustbook where id="&id
rsb.open sql2,conn,1,3
if ok="yes" then
rsb("sort")=rsb("sort")+1
end if
if ok="No" then
rsb("sort3")=rsb("sort3")+1
end if
rsb.update
rsb.close
response.redirect "book_list2.asp?id="&id
end if
select case action
case "edit"
Public Function FilterHtml(Str)
If Trim(Str) = "" Or IsNull(Str) Then
FilterHtml=""
Else
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, Chr(32), " ")
Str = Replace(Str ,Chr(9), " ")
Str = Replace(Str, Chr(34), """)
Str = Replace(Str, Chr(39), "'")
Str = Replace(Str, Chr(13), "")
Str = Replace(Str, Chr(10) & Chr(10), "</p><p>")
Str = Replace(Str, Chr(10), "<br> ")
FilterHtml = Str
End If
End Function
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from gustback",conn,1,3
rs.addnew
rs("parantid")=lcase(trim(request("id")))
rs("othercontent")=FilterHtml(trim(request.form("content")))
rs("backdate")=now()
rs.update
rs.close
set rs=nothing
response.redirect "book_list2.asp?id="&id
end select
%>
<div align="center">
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 >
<table width="1004" height="13" border="0" cellpadding="0" cellspacing="0" id="table6" bgcolor="#FFFFFF">
<tr>
<td></td>
</tr>
</table>
<table border="0" width="1004" cellpadding="0" style="border-collapse: collapse" bordercolor="#E4E4E4" bgcolor="#FFFFFF">
<tr>
<td width="220" align=center valign="top">
<!--#include file="in_news.asp"-->
</td>
<td bgcolor=#D5D5D5 width=1></td>
<td valign="top" align="center">
<table border="0" width="100%" id="table28" cellspacing="0">
<tr>
<td>
<p align="center"> </td>
</tr>
</table>
<table width=700 border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="93%">
<table width="100%" height="33" border="0" cellpadding="0" cellspacing="0" id="table9">
<tr>
<td width="5%" align="center"> </td>
<td width="95%" class="sytle_blue_c">在线留言</td>
</tr>
</table>
<table width="98%" height="5" border="0" cellpadding="0" cellspacing="0" background="images/xx3.jpg" id="table10">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<div align="center">
<table border="0" width="100%" id="table27">
<tr>
<td> </td>
</tr>
</table>
<table class="mart5" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table16">
<tr>
<td class="pr10" vAlign="top" width="736">
<table style="BORDER-RIGHT: #f476a6 1px solid; BORDER-TOP: #f476a6 1px solid; BORDER-LEFT: #f476a6 1px solid; BORDER-BOTTOM: #f476a6 1px solid" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table19">
<tr>
<td style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px" vAlign="top">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table20">
<tr>
<td height=50 width="100%" colspan="4">留言标题:<%=rsb("web")%></td>
</tr>
<tr>
<td height=50 width="27%">留言人:<%=rsb("username")%></td>
<td width="29%">
时 间:<%=rsb("adddate")%></td>
<td width="22%">
附议次数:<%=rsb("sort")%>次</td>
<td width="21%">
浏览次数:<%=rsb("countss")%>次
</td>
</tr>
<tr>
<td vAlign="top" width="100%" colspan="4">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table21">
<tr>
<td class="f14 bd" style="line-height:180%" height="30"><%=rsb("content")%></td>
</tr>
<tr>
<td class="f14" ></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="mart10" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table22">
<tr>
<td width="25%" height="31">
您是否附议他的建议或意见:</td>
<td width="75%">
 
<a href="?ok=yes&id=<%=rsb("id")%>" onclick="{if(confirm('真的要顶吗')){return true;}return false;}" title="顶">顶</a>
<%if rsb("sort")<>"" then response.write "("&rsb("sort")&")" %>
 
<a href="?ok=no&id=<%=rsb("id")%>" onclick="{if(confirm('真的要踩吗?')){return true;}return false;}" title="踩">踩</a>
<% if rsb("sort3")<>"" then response.write "("&rsb("sort3")&")" %>
</td>
</tr>
<tr>
<td width="25%" height="31">
其他人关于本主题的建议:</td>
<td width="75%"> </td>
</tr>
<tr>
<td height="11" colspan="2">
</td>
</tr>
</table>
<table style="BORDER-RIGHT: #f476a6 1px solid; BORDER-TOP: #f476a6 1px solid; BORDER-LEFT: #f476a6 1px solid; BORDER-BOTTOM: #f476a6 1px solid" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table23" height="64">
<tr>
<td style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px" vAlign="top">
<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table24">
<tr>
<td vAlign="top" width="100%"><br>
<table style="word-break:break-all;word-wrap:break-all;" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table25">
<% do while not rsb.eof %>
<tr>
<td class="f14 bd" style="line-height:180%">
·
<%=rsb("othercontent")%></td>
</tr>
<%
rsb.movenext
if rsb.eof then exit do
loop
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="mart10" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table26">
<form name="back" method="post" action="book_list2.asp?action=edit&id=<%=id%>">
<tr><td height="12"></td><td></td>
</tr>
<tr>
<td width="24%" >
<p align="right">您的补充建议或意见:</td>
<td height="22" width="76%">
<textarea name="content" cols="45" rows="8" id="content0" class=wenbenkuang></textarea>
</td>
</tr>
<tr>
<td height="28" colspan="2" >
<p align="center">
<input type="submit" class=post value="提交信息" name="submit" ></tr>
</form>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</table>
</div>
<!--#include file=webfoot.asp-->