投票H5页面制作教程:
一、创建空白活动
就以人人秀为例,如果没有账号的话,先注册一个账号,然后点击个人中心——创建活动——空白活动,然后就会进入到H5编辑器。
二、添加投票插件
进入到H5编辑器之后,可以看见右侧的工具栏,点击互动——照片投票,加入投票插件。
三、完善投票设置
然后点击右侧的投票设置,先选择基本设置中的投票类型,有照片投票、语音投票以及视频投票三种可以选择。然后开始完善其他的内容管理、投票设置以及报名设置,样式设置等等。
四、直接套用模板
如果不想这么麻烦的话,还可以直接选择套用模板,可以到模板商店中选择自己看中的模板设计,直接点击使用后进入编辑器,然后更改相关设置即可。
五、数据查看
当投票H5作品发布之后,可以在个人中心中选中发布的作品,点击数据,到数据汇总查看具体详情。
无需注册, 哪里来的用户名,可记录IP还差不多,谁会在投票时,老老实实的给你真实姓名,ACCESS里哪里会清楚看清什么人投了票呢?把问题说清楚点,如果只是随便添一个名字即可投票的话,一个IP只能头一次的话,或许我可以帮你.更麻烦的投票系统我都有. 可以CALL我,RSZXGESL@163.COM=============给你部分文件代码(执行文件code.asp)=====================
<!--#include file="conn.asp"-->
<% t=now()
t1=Datevalue(t)
t2=Datevalue("12 30, 2009") '投票截止时间设置
if t1<= t2 then
on error resume next
v=request.Form("voter")
rip=lcase(request.form("ip"))
if request.Form("voter")="" then '判断是否填写投票者
Response.Write("<script language=""JavaScript"">alert(""请填写投票者姓
名!!"")history.go(-1)</script>")
end if
if request.Form("r1")=""and request.Form("r2")="" and request.Form("c3a")=""and
request.Form("c3b")=""and request.Form("c3c")=""and request.Form("c3d")=""and request.Form
("c3e")=""and request.Form("c3f")=""and request.Form("s4")=""and request.Form("t5")="" then
'判断是否投票完毕
wr=true
else
wr=false
end if
if wr=true then
Response.Write("<script language=""JavaScript"">alert(""你还没有填写调查问卷,请你填写调
查卷,谢谢你的合作!!"")history.go(-1)</script>")
else
'dim rip as string
'rip="127.0.0.1"
set rst=server.CreateObject("ADODB.recordset") '判断提交IP是否已经投票过
rst.Open "select * from [tab] where [ip]='" &rip &"'",conn,1,1
if not(rst.bof and rst.eof) then
Response.Write("<script language=""JavaScript"">alert(""不好意思,
你已经投票过!"")history.go(-1)</script>")
else
set rs=server.CreateObject("ADODB.recordset") '若没投过,则写入投
票信息
rs.open "tab",conn,1,3
conn.begintrans
rs.addnew
t1=request.Form("r1")
t2=request.Form("r2")
t3=request.Form("c3a") &request.Form("c3b") &request.Form("c3c") &request.Form("c3d") &
request.Form("c3e") &request.Form("c3f")
t4=request.Form("s4")
t5=request.Form("t5")
v=request.Form("voter")
ip=request.form("ip")
rs("t1")=t1
rs("t2")=t2
rs("t3")=t3
rs("t4")=t4
rs("t5")=t5
rs("voter")=v
rs("IP")=ip
rs.update
rs.close
if err.number<>0 then
conn.rollbacktrans
Response.Write("<script language=""JavaScript"">alert(""由于出错,数据不能保
存!"")history.go(-1)</script>")
else
conn.CommitTrans
Response.Write("<script language=""JavaScript"">alert(""谢谢你珍贵的一票!"")history.go(-
1)</script>") end if
end if
end if
else
Response.Write( "调查时间已过期,还是谢谢你的关心")
end if
%>
<% set rst=nothing
conn.close
set conn=nothing
%>
=============结束!===========================
我已经把本系统资料发送给到你邮箱,如果你觉得需要,就回我,我把系统源文件给你送去。
昨天你就问过这个问题了。好吧。给你写一个吧。现写的没有测试。你试下。有什么问题再问我。表一:【Vote】1-ID【ID】自动编号
2-名称【Title】文本255
3-关联ID【GLID】数值:关联信息的ID以便在显示时区分不同信息的投票内容表二:【VoteInfo】
1-ID【ID】自动编号
2-名称【Title】文本255
3-点击量【Click】数值
4-关联ID【GLID】数值:关联表一的ID。建立多个投票选项
5-分数【Score】数值:单个选项的分数,-100~100
6-图标地址【ICOFile】文本255:显示图标的地址。建立原理:
制作显示的图片。
pic001a.gif 最大值的红色图
pic001b.gif 一般值得的图片
表一的GLID值不能为空。这个值是你的信息的ID值 <%
'连接数据内容省略
%><!--#include file = Conn.asp --><%
'Infoid为你信息的ID
if Infoid<>"" then
sqlVote = "select * from Vote where Title<>''"
sqlVote = sqlVote &" and [GLID]="&Infoid
Set rsVote = Server.CreateObject("ADODB.RecordSet")
rsVote.Open sqlVote,conn,1,1
if rsVote.recordcount<>0 then '最高记录数
sqlmax="select max(Click) as maxClick from VoteInfo"
Set rsmax = Server.CreateObject("ADODB.RecordSet")
rsmax.open sqlmax,conn,1,1
Max_Click=int(rsmax("maxClick"))
rsmax.close
set rsmax=nothing
sqlVoteInfo = "select * from VoteInfo where Title<>''"
sqlVoteInfo = sqlVoteInfo &" and [GLID]="&rsVote("ID")
Set rsVoteInfo = Server.CreateObject("ADODB.RecordSet")
rsVoteInfo.Open sqlVoteInfo,conn,1,1
if rsVoteInfo.recordcount<>0 then
%>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="120">
<tr>
<%
for VoteInfoi=1 to rsVoteInfo.recordcount'Max_Click最大的一个数值为100'这里可以加N个条件来显示图的结果。
if rsVoteInfo("Click")=Max_Click then
InfoIMG="pic001a.gif"
else
InfoIMG="pic001b.gif"
end if
%>
<td height="100">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="120">
<tr>
<td height="100" width="100%" valign=bottom align=center>
<%=rsVoteInfo("Click")%>
<br>
<img src="<%=InfoIMG%>" height="<%=int(rsVoteInfo("Click")/Max_Click*100)%>" width="30">
</td>
</tr>
<tr>
<td height="20" width="100%">
<%=rsVoteInfo("Title")%>
</td>
</tr>
</table>
</td>
<%
rsVoteInfo.movenext
if rsVoteInfo.eof then exit for
next
%>
</tr>
</table>
<%
end if
rsVoteInfo.close
set rsVoteInfo=nothing end if
end if
rsVote.close
set rsVote=nothing
conn.close '关闭数据库
set conn=nothing
%>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)