clannad光玉怎么看:高价求寻*.asp?a=92这样ASP的例子,如被采纳,再加100分

来源:百度文库 编辑:中科新闻网 时间:2024/05/04 08:47:52
比如说有很多链接都是用的类似这样的,*.asp?a=92,*.asp?a=93,*.asp?a=94等如何做,请提供给样例如何。mail:sfeixue@163.com

把下面的代码另存为ASP文件,并在ASP执行环境运行一下,你就明白了。
?后面的是代表给页面传值a=92就是说,在下一个页面中可以用request("a")
取到92这个值

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试文件</title>
</head>
<%
if request("id")=1 then response.write "执行ID为1的操作<br>"
if request("id")=2 then response.write "执行ID为2的操作<br>"
if request("id")=3 then response.write "执行ID为3的操作<br>"
if request("id")=4 then response.write "执行ID为4的操作<br>"

a=1
do while a<5
response.write "<a href=test.asp?id="&a&">test.asp?id="&a&"</a><br>"
a=a+1
loop%>
<body>
</body>
</html>

*.asp?a=92
没有看懂你要找什么?

建立一个test.ASP文件
<%
dim intID
intID=request("a")
%>
<html>
<head>
<title>test</title>
</head
<body>
<table align="center" width=500 height=500>
<tr><td>你的ID值为:<font color=red><%=intID%></font>
</td></tr>
</table>
</body>
</html>
将test.asp拷贝到iis 主目录
分别输入
http://localhost/test.asp
http://localhost/test.asp?a=92
看看结果罗

楼上的,指点我一点东西!可以吗?