| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 781 人关注过本帖
标题:求教高手,帮忙看看这个页面点“顶”和“踩”数据库字段值不会变化
只看楼主 加入收藏
小米1900
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-5-15
收藏
 问题点数:0 回复次数:3 
求教高手,帮忙看看这个页面点“顶”和“踩”数据库字段值不会变化
<!--#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, ">", "&gt;")
    Str = Replace(Str, "<", "&lt;")
    Str = Replace(Str, Chr(32), "&nbsp;")
    Str = Replace(Str ,Chr(9), "&nbsp;")
    Str = Replace(Str, Chr(34), "&quot;")
    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%">
                        &nbsp;&nbsp;&nbsp
                        <a href="?ok=yes&id=<%=rsb("id")%>" onclick="{if(confirm('真的要顶吗')){return true;}return false;}" title="顶">顶</a>
                        <%if rsb("sort")<>"" then response.write "("&rsb("sort")&")" %>
                        &nbsp;&nbsp;&nbsp
                        <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-->
搜索更多相关主题的帖子: request content keyword include action 
2014-05-15 15:11
小米1900
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-5-15
收藏
得分:0 
怎么没有高手帮忙啊,看一下错在哪里?在本页上刷新的。

[ 本帖最后由 小米1900 于 2014-5-16 09:44 编辑 ]
2014-05-16 09:42
小米1900
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-5-15
收藏
得分:0 
自个儿找到问题了。在if ok<>"" then 下面加一条set rsb=server.createobject("adodb.recordset")就实现了
2014-05-19 10:02
zp998
Rank: 2
来 自:江西
等 级:论坛游民
帖 子:27
专家分:48
注 册:2012-5-2
收藏
得分:0 
自学成才呀,真不错。
2014-06-12 14:50
快速回复:求教高手,帮忙看看这个页面点“顶”和“踩”数据库字段值不会变化
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022994 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved