谁又最简单最明了的调查问卷源代码,谢谢!

Zuomeng 2004-07-30 09:14:11
谁又最简单最明了的调查问卷源代码,很简单,我就是想知道别人对我网站的满意程度,设置了三个单选按钮,通过点击率察看一下,用比例图示展现出来,我该怎么写?谢谢!
...全文
1756 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
makay 2004-07-31
  • 打赏
  • 举报
回复
对,中国站长网的资源非常丰富。
www.chinaz.com
lnqnwy 2004-07-31
  • 打赏
  • 举报
回复
中国站长站:http://www.chinaz.com/DownLoad/L/16_Lastuptime_Desc_1.asp
http://www.asp300.com/CodeList/Catalog_8_CodeDate_Desc_1.html
这两页都有调查的程序!自己下两个看看!可以直接用!最好研究研究他们的代码,自己编一个,这样才能学到东西!调查是一个比较简单的系统!
Zuomeng 2004-07-31
  • 打赏
  • 举报
回复
拜托啊,有高手吗?
Zuomeng 2004-07-31
  • 打赏
  • 举报
回复
拜托了,给我一个原代码吧!我很想知道怎么作的呀,我做过,可是没有作出来啊,谢谢呀!
Zuomeng 2004-07-31
  • 打赏
  • 举报
回复
拜托啊,我找不到,谢谢
雄牛 2004-07-31
  • 打赏
  • 举报
回复
推荐一个不错的源码下载站http://www.szfox.com/code
prcak47 2004-07-31
  • 打赏
  • 举报
回复
后台程序
<body>
<!--#include virtual="/function/conn.asp" -->
<!--#include virtual="/function/share.asp" -->
<!--#include virtual="/top.asp" -->
<%
dim answer,ip
answer = request("radiobutton")
ip=request.servervariables("REMOTE_HOST")

if answer<>"" then
Conn.Execute "Insert Into tb_choice(c_choice,c_ip,c_dt) Values('" & answer & "','" & ip & "',now)"
end if

dim allcount,tel,mail,face,online
allcount=Conn.Execute("select Count(c_choice) from tb_choice")(0)
tel=Conn.Execute("select Count(c_choice) from tb_choice where c_choice='tel'")(0)
mail=Conn.Execute("select Count(c_choice) from tb_choice where c_choice='mail'")(0)
face=Conn.Execute("select Count(c_choice) from tb_choice where c_choice='face'")(0)
online=Conn.Execute("select Count(c_choice) from tb_choice where c_choice='online'")(0)
%>
<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50"> </td>
<td height="20" colspan="3"> </td>
<td width="50"> </td>
</tr>
<tr>
<td> </td>
<td height="30" colspan="3" align="center" bgcolor="#c8c8c8"> <strong>调 查
<img src="/choice/img/nc_2.gif" width="16" height="16"> 统 计</strong></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td height="20" colspan="3" align="center" valign="middle" bgcolor="#eeeeee"><strong>你喜欢采取以下哪些方式进行咨询?</strong></td>
<td> </td>
</tr>
<tr>
<td rowspan="17"> </td>
<td width="50">  </td>
<td height="30">一、电话咨询 (得票数:<% response.write (tel) %> ) </td>
<td width="50"> </td>
<td rowspan="17"> </td>
</tr>
<tr>
<td rowspan="3"> </td>
<td> </td>
<td rowspan="3"> </td>
</tr>
<tr>
<td><table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500"><img src="/choice/img/0.gif" width="<% = int((tel/allcount)*500) %>" height="20"></td>
<td width="50">
<% response.write FormatNO((tel/allcount)*100)&"%" %>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td height="30">二、书信咨询 (得票数:<% response.write (mail) %>) </td>
<td> </td>
</tr>
<tr>
<td rowspan="3"> </td>
<td> </td>
<td rowspan="3"> </td>
</tr>
<tr>
<td><table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500"><img src="/choice/img/1.gif" width="<% = int((mail/allcount)*500) %>" height="20"></td>
<td width="50">
<% response.write FormatNO((mail/allcount)*100)&"%" %>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td height="30">三、当面咨询 (得票数:<% response.write (face) %>) </td>
<td> </td>
</tr>
<tr>
<td rowspan="3"> </td>
<td> </td>
<td rowspan="3"> </td>
</tr>
<tr>
<td><table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500"><img src="/choice/img/2.gif" width="<% = int((face/allcount)*500) %>" height="20"></td>
<td width="50">
<% response.write FormatNO((face/allcount)*100)&"%" %>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
<td height="30">四、在线咨询 (得票数:<% response.write (online) %>)</td>
<td> </td>
</tr>
<tr>
<td rowspan="3"> </td>
<td> </td>
<td rowspan="3"> </td>
</tr>
<tr>
<td><table width="550" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500"><img src="/choice/img/3.gif" width="<% = int((online/allcount)*500) %>" height="20"></td>
<td width="50">
<% response.write FormatNO((online/allcount)*100)&"%" %>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="20" colspan="3" align="right" bgcolor="#eeeeee"><strong>总共有
<% response.write (allcount) %>
人参加调查,累计投票:
<% response.write (allcount) %>
张。</strong></td>
</tr>
<tr>
<td rowspan="2"> </td>
<td height="30" colspan="3" bgcolor="#c8c8c8"> </td>
<td rowspan="2"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
<% conn.close
set conn=nothing
%>
<!--#include virtual="/bottom.asp" -->
</body>
prcak47 2004-07-31
  • 打赏
  • 举报
回复
主页引用
<form name="form1" method="post" action="/choice/choice.asp">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20"> </td>
<td height="20">你喜欢采取以下哪些<br>
方式进行咨询?</td>
</tr>
<tr>
<td width="20%" align="right"> <input type="radio" name="radiobutton" value="tel">
</td>
<td width="80%" height="20">一、电话咨询</td>
</tr>
<tr>
<td align="right"> <input type="radio" name="radiobutton" value="mail">
</td>
<td height="20">二、书信咨询</td>
</tr>
<tr>
<td align="right"> <input type="radio" name="radiobutton" value="face">
</td>
<td height="20">三、当面咨询</td>
</tr>
<tr>
<td align="right"> <input type="radio" name="radiobutton" value="online">
</td>
<td height="20">四、在线咨询</td>
</tr>
<tr align="center">
<td height="40" colspan="2"> <input type="submit" name="Submit" value="提交">
 <a href="/choice/choice.asp">查看结果</a></td>
</tr>
</table>
</form>
lordwudee 2004-07-31
  • 打赏
  • 举报
回复
我的代码,嘿嘿,功能可以但是写法比较朴素

rate.asp(打分页)
=============================
<!--#include file="conn.asp"-->
<%
on error resume next
dim conn,fds,rate
rate=request.Form("txtRate")
if isempty(rate) then
response.redirect("default.asp")
end if
if session("rate")=1 then
%>
<script language="javascript">
alert("您不能不停地打分哦!");
window.location.replace("default.asp");
</script>
<%
response.end
end if
if rate<>0 and rate<>1 and rate<>2 and rate<>3 and rate<>4 and rate<>5 and rate<>6 and rate<>7 and rate<>8 and rate<>9 or rate>9 or rate<0 then
%>
<script language="javascript">
alert("请您输入0~9以内的整数!");
window.location.replace("default.asp");
</script>
<%
response.end
end if
rate=cint(rate)
call opendata()
fds.open "select * from rate where id=1",conn,3,3
application.lock
fds("rate"&rate)=fds("rate"&rate)+1
fds("ratecount")=fds("ratecount")+rate
fds("guestcount")=fds("guestcount")+1
fds.update
application.unlock
call closedata()
session("rate")=1
%>
<script language="javascript">
alert("打分成功!")
window.location.replace("default.asp?type=open");
</script>

view_rate.asp(显示页)
========================================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看打分情况</title>
<link href="main.css" type="text/css" rel="stylesheet" />
</head>
<!--#include file="conn.asp"-->
<%
dim conn,fds,average
call opendata()
fds.open "select * from rate where id=1",conn,3,3
average=formatnumber(fds("ratecount")/fds("guestcount"),2)
%>
<body topmargin="0" leftmargin="0">
<table width="420" height="300" border="0" align="center" cellpadding="0" cellspacing="0" class="hccTableBorder">
<tr>
<td height="25" background="image/hcc_title_rate.gif" class="hccTahomaWhiteBold">   打分结果至<span class="hccVerdanaBlackSmall">[<%=fds("d")&" "&fds("t")%>]</span>时的统计:</td>
</tr>
<tr>
<td height="20" align="center" class="hccTableBorderBottom"><span class="hccTahomaBlackBold"> 有</span><span class="hccRate">"<%=fds("guestcount")%>"</span><span class="hccTahomaBlackBold">人参与了打分 目前HCC平均得分为:</span><span class="hccRate"><%=average%></span></td>
</tr>
<tr>
<td height="10" align="center"> </td>
</tr>
<tr>
<td height="200"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<%for i=0 to 9%>
<tr>
<td width="10%" height="20" align="right"><span class="hccTahomaBlackBold"><%=i%>分:</span></td>
<td width="90%" height="20">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5"></td>
<td width="<%=300*fds("rate"&i)/fds("guestcount")+1%>" height="15" background="image/hcc_rate_sheet.gif"></td>
<td class="hccVerdanaBlackSmall"><%=formatnumber(100*fds("rate"&i)/fds("guestcount"),2)%>%</td>
</tr>
</table>
</td>
</tr>
<%next%>
</table></td>
</tr>
<tr>
<td height="10" class="hccTahomaBlackBold"></td>
</tr>
<tr>
<td height="25" background="image/hcc_background_grey.gif" class="hccTableBorderTop"><div align="center" class="hccTahomaBlackBold">感谢您对HCC的支持!</div></td>
</tr>
</table>
</body>
</html>
<%
call closedata()
%>
SxXueChunQing 2004-07-31
  • 打赏
  • 举报
回复
留下Email, 给你一份
lordwudee 2004-07-30
  • 打赏
  • 举报
回复
思路:在数据库里建一个表,表里只有一条数据即可,其中有三列分别是你的三个按钮的点击率,点一次加一。再有一列存总点击数,之后输出的时候用比例输出取百分数。
输出图示的话用表格的background在设定宽度就可以了。
我自己编过一个:www.shiyihcc.com在首页上,左边偏下。
mjpclab 2004-07-30
  • 打赏
  • 举报
回复
自己写吧,不难啊

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧