一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

故事接龙2 handlevote.asp

时间:2008-01-18 编辑:简简单单 来源:一聚教程网

<%@ Language=VBScript %>
<%
'以下为处理投票的asp程序
if Request.ServerVariables("http_method")="POST" then
    if Request.Form("voteradio")<>"" then
        '只有用户选择了认为续写得好得文章才进行处理
        set rec=server.CreateObject("adodb.recordset")
        rec.ActiveConnection="dsn=vote"
        if Request.Form("votecomment")<>"" then
       '将用户的留言加入到数据中
       rec.Source="select * from tbcomment"
       rec.Open ,,1,3
       tempstr=Request.Form("votecomment")
       rec.AddNew
       rec("userip")=Request.ServerVariables("remote_addr")
       rec("comment")=tempstr
       rec.Update
       rec.Close
       tempstr="
" & tempstr & "
"
       tempstr=tempstr & "

你投了一票,谢谢

"
        else
       '如果用户没有留言,则
       tempstr="这位网友没什么话要说,他/她只是觉得这篇文章接的很好,所以投了一票"
        end if
        '根据用户的投票更新记录投票次数的数据库

热门栏目