永发信息网

asp投票,按钮是图片,提交不成功

答案:3  悬赏:40  手机版
解决时间 2021-06-01 02:19

asp投票模块,按钮是图片的,提交不成功

不知道哪里有问题,请高手指点一下

<!--#include file="inc/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<table width="244" height="194" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="245" height="22" align="left" background="images/mm_ai.jpg">&nbsp; 在线调查</td>
</tr>
<tr>
<td height="175" align="center" valign="top" background="images/mm_ao.jpg">
<form id="form1" name="form1" method="post" action="">
<table width="82%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td height="21" align="left">您是通过何种方式了解本站的?</td>
</tr>
<%
sql_tou="select * from tou"
set rs_tou=conn.execute(sql_tou)
%>
<%do while rs_tou.eof=false%>
<tr>
<td height="19" align="left"><input name="id" type="radio" value="<%=rs_tou("id")%>" />
<%=rs_tou("touitem")%></td>
</tr>
<%rs_tou.movenext
loop%>
<tr>
<td height="24" align="left" valign="bottom"> &nbsp;&nbsp;
<input name="submit" type="image" id="submit" value="投票" src="images/toupiao.jpg" />
&nbsp; <img src="images/chakan.jpg" width="47" height="15" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
<%
if request.Form("submit")="投票" then
id=request.Form("id")
sql2="update tou set toucount=toucount+1 where id="&id
conn.execute(sql2)
%>
<script language="javascript">
alert('恭喜您,投票成功!');
</script>
<%
end if
%>

最佳答案
toucount 项目要是“数字型”的,给<input name="id" type="radio" value="<%=rs_tou("id")%>" />加个id="id" 试试。
全部回答

<form id="form1" name="form1" method="post" action=""> 改成

<form id="form1" name="form1" method="post" action="?submit=投票">

代码看不出问题,唯一可疑的就 request.Form("submit")这个接收到的值,你可以在if request.Form("submit")="投票" then之前输出来看看,是否真的是投票,因为有中文有可能乱码
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
红色小吊带外面配什么颜色的外套
怀孕十周了胃口大增了怀男孩几率大吗?
世界前五的名鞋是
英语语法是怎么弄的啊?
玫瑰花的葬礼MP3地址是什么?空间可以的
诛仙2仙阵营造化点需要多少?
时间计算:从2010年2月2日到现在共有多少天?
qq网吧网关是什么??
关于这个生物股长的MV,达人鉴定下,这个是不
打开使命召唤时弹出一个窗口
怎样能够不用花钱就能学艺体考大学?
网球王子里那些人小时候就认识的
山东财政学院与山东财政学院东方学院有什么关
DNF交易现在有新骗术吗?
怎样才能让自己不受别人的干扰,过得快乐一点
推荐资讯
梦幻西游可以用梦幻币买点卡吗?在哪换
怎样制作图片吗
我家的玄武为什么是满屏啊?
求一个改拍拍颜色代码的教程
行为违法与违法行为的区别
鬼泣4试玩版可以玩多久.
怎样将我的图片由BMP改为JPEG图像
Sbazzo,Crazy Chsbazzo,Crazy Chef 这是什么
万佛朝宗是什么意思,万佛朝宗的真正含义是什
怎么复制说过的话
帮忙给小说中的人物起名字
求宠物小精灵黑白游戏(模拟器)PC
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?