回 帖 发 新 帖 刷新版面

主题:跪求,高手帮忙编写代码!!!使用ASP

我是个刚学习ASP的,想请教一个跳转网页的代码。

例子如下:
比如我有3个选择题

1.你喜欢吃的东西
A.橘子B.香蕉C.苹果

2.你喜欢的动物
A.小狗B.小猫C.小马

3.你喜欢的风景
A.沙漠B.大海C.森林

假设其中编写了计数器程序分别对选择A,B,C进行计数,然后在进行判断比较
A多,就跳转到www.a.com
B多,就跳转到www.b.com
C多,就跳转到www.c.com

(暂不考虑A,B,C共同选择的情况)

还要请教下,如果配合Dreamweaver表单提供的单选按钮,我该怎样操作,或者怎么编写程序?这个问题一定要完全手写代码吗?

真的非常迫切希望得到高手的帮助!万分感谢……

回复列表 (共1个回复)

沙发

<body>
<%
r1=cint(request.Form("r1"))
r2=cint(request.Form("r2"))
r3=cint(request.Form("r3"))
q1=cint(request.Form("q1"))
q2=cint(request.Form("q2"))
q3=cint(request.Form("q3"))
s1=cint(request.Form("s1"))
s2=cint(request.Form("s2"))
s3=cint(request.Form("s3"))
a=r1+q1+s1
b=r2+q2+s2
c=r3+q3+s3
if a>b and a>c then
response.redirect("www.a.com")
end if
if b>a and b>c then
response.redirect("www.b.com")
end if
if c>a and c>b then
response.Redirect("www.c.com")
End if
%>
<form id="form1" name="form1" method="post" action="qqq.asp">
    <p>你喜欢吃的东西:</p>
    <input type="radio" name="r1" value="1" />a橘子
    <input type="radio" name="r2" value="1" />b香蕉
    <input type="radio" name="r3" value="1" />c苹果
    <p>你喜欢的动物:</p>
    <input type="radio" name="q1" value="1" />a小猫
    <input type="radio" name="q2" value="1" />b小狗
    <input type="radio" name="q3" value="1" />c小马
     <p>你喜欢的风景:</p>
    <input type="radio" name="s1" value="1" />a沙漠
    <input type="radio" name="s2" value="1" />b大海
    <input type="radio" name="s3" value="1" />c森林
    <input type="submit" value="确定">
</form>
</body>[em8][em8][em8][em8][em8][em8][em8][em8][em8][em8]

我来回复

您尚未登录,请登录后再回复。点此登录或注册