标题:求助:无法提交进数据库
只看楼主
bingyu_6133
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-9-26
 问题点数:0 回复次数:0 
求助:无法提交进数据库

<!--#include file="vote/conn.asp"-->
<%
'调用方式:<Script Language="JavaScript" SRC="vote/loveu99_Vote.asp?top=3"></Script>
color1="#003399" '投票说明字体颜色
color2="#000000" '投票项字体颜色
color3="FF9900" '投票按钮背景颜色
dim aa
aa=0
FOR EACH name IN Request.Form("rc")
aa=aa+1
NEXT
IF aa>3 THEN
Response.write "<Script language=JavaScript>alert('你选择太多了!')</Script>;"
Response.write "<Script language=JavaScript>location.replace('loveu99_VoteView.asp?ID=4');</Script>"
Response.end
END IF
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
IF Request.Form("IsSub")="YES" THEN
SS=Request.Form("SS") '投票序号
Set rs=conn.execute("Select Vote_Limit From Vote_list Where ID="&SS)
Limit=Cint(rs(0))
rs.close
Vote_Ok=False
IF Limit=2 THEN
IF Request.Cookies("loveu99_vote_"&SS)="DONE" THEN
Vote_Ok=True

ELSE
Response.Cookies("loveu99_vote_"&SS) = "DONE"
Response.Cookies("loveu99_vote_"&SS).Expires = date()+time()+TimeSerial(1,0,0) '设置cookie的过期日
END IF
END IF

IF Vote_Ok=True THEN
Response.write "<Script language=JavaScript>alert('请不要重复投票!')</Script>;" '这里自己可以设置下面基本上都不用改了
ELSE
FOR EACH name IN Request.Form("rc")
conn.execute "Update Vote_Answer Set VoteResult=VoteResult+1 Where ID="&name
NEXT
Response.write "<Script language=JavaScript>alert('您已投票成功,谢谢您得参与!')</Script>;"
END IF
Response.write "<Script language=JavaScript>location.replace('index.asp');</Script>"
END IF


top=Cint(Request.QueryString("top"))
IF top<1 THEN top=1
Set rs=conn.execute("Select Top "&top&" ID,Project,MultiSelect From Vote_List Where online=True Order By ID DESC")
IF rs.eof THEN
Response.write "<font color=red>目前还没有投票项目</font>"
ELSE
Set rs2=Server.Createobject("ADODB.RecordSet")
While NOT rs.eof
Response.write "<table border=0 cellspadding=0 width='100%' align=center bgcolor=#84D36B><form method=POST action='loveu99_Vote.asp' target=_blank><tr><td><input type=hidden name=IsSub value=YES><input type=hidden name=SS value="&rs(0)&">"
Response.write "<br>"
rs2.open "Select ID,VoteContent From Vote_Answer Where ListID="&rs(0),conn,1,1

Response.write "<tr align=center><td><a href=images/nopic.jpg target='_blank'></td><td><a href=images/nopic.jpg target='_blank'></td><td><a href=images/3.JPG target='_blank'></td><td><a href=images/nopic.jpg target='_blank'></td>"
Response.write "<tr align=center><td><input type=checkbox name=rc value=20>文章作品</td><td align=left><input type=submit value=投票 style=background-color:"&color3&"> </td>"
Response.write "<tr align=center><td colspan='2' rowspan='2' align=left>&nbsp;&nbsp;&nbsp;投票说明:<p>&nbsp;&nbsp;1、在你满意的文章作品下打“√”后,点击投票即可;<p>&nbsp;&nbsp;2、每人选投文章作品每天只能投1次,重复投选票无效;<p>&nbsp;&nbsp;3、投票截止到2006年10月31日。</td>"
rs2.close
Response.write "<tr><td></td><td></td></tr>"
Response.write "</td></tr></form></table><br>"
rs.MoveNext
WEND
Set rs2=nothing
END IF

rs.close
Set rs=nothing
conn.close
Set conn=nothing
%>

搜索更多相关主题的帖子: 数据库 Script vote Response 
2006-09-26 13:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-93035-1-1.html




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

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