<html>
<head>
<title>
toupiao
</title>
</head>
<body>
<form name="name" action="tp.asp" method="post">
<input type="text" name="aa"><br>
<input type="submit" value="投票">
</form>
<%
if request.form.count > 0 then
dim a, b, c, ps
ps=request.form("aa")
if ps="1" then
a=a+1
elseif ps="2" then
b=b+1
elseif ps="3" then
c=c+1
end if
response.write "A:" & a & "<br>"
response.write "B:" & b & "<br>"
response.write "c:" & c & "<br>"
end if
%>
</body>
</html>
你的好多错误的
dim a,b,c后a=多少?b=多少?c=多少?
而ps=1却经常并不等于"1",知道为什么吗?因为有时1是文本,有时1是数字。
<!--投票界面-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<form name="name" action="tp.asp" method="post">
<input type="text" name="aa"><br>
<input type="submit" value="投票">
</form>
</body>
</html>
<!--保存界面-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<%
if request.form.count > 0 then
ps=request.form("aa")
if ps="1" then
session("a")=session("a")+1
elseif ps="2" then
session("b")=session("b")+1
elseif ps="3" then
session("c")=session("c")+1
end if
response.write "A:" & session("a") & "<br>"
response.write "B:" & session("b") & "<br>"
response.write "c:" & session("c") & "<br>"
end if
%>
<a href="tp.asp">继续投票</a>
</body>
</html>