刀剑2那个职业好:如何知道ASP处理页面中需要获取的数据?

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 07:34:11
现在有一个Action.asp页面需要处理来自VOTE.asp页面发送过来的信息.现在我只能看到VOTE.ASP这个页面.我想通过在地址栏中输入这样的信息:VOTE.ASP?ID=52来直接提交信息!但是不知道ACTION.ASP需要的是什么信息,能很容易弄清楚吗?下面是VOTE.ASP里面的一段代码:

document.write ("<html><head><title></title>");
document.write ("<link href='css.css' rel='stylesheet' type='text/css'>");
document.write ("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>");
document.write ("</head><body>");
document.write ("<form method='post' action='votes.asp'><table border='1' cellpadding='2' cellspacing='0' bordercolordark='#f7f7f7' bordercolorlight='#cccccc' class='inputt'>");

document.write ("<a href='htm/zhyy.htm' target='_blank'><img src='pic/zhyy.jpg'></a><br>")

document.write ("<input type='checkbox' name='v' value='66'><a href='htm/zhyy.htm' target='_blank'>法政学院050913班 张元元</a><br>");

document.write ("</td>");

document.write ("<tr>");

document.write ("<td>");

document.write ("<a href='htm/sdsh.htm' target='_blank'><img src='pic/sdsh.jpg'></a><br>")

document.write ("<input type='checkbox' name='v' value='67'><a href='htm/sdsh.htm' target='_blank'>艺术学院020712班 宋端树</a><br>");

document.write ("</td>");

document.write ("</table></td></tr>");
document.write ("<tr><td bgcolor='#f7f7f7' height='30' align='center'><input type='hidden' name='idd' value='9'><input type='submit' name='submit' value='投票' class='inputt'>  <input type='button' name='button1' value='查看' class='inputt' onclick=window.open('view.asp?id=9','vie','scrollbars=yes,resizable=yes,width=550,height=250');><input type='hidden' name='id' value='9'><input type='hidden' name='chk' value='2'></td></tr></table></form></body></html>");

在action.asp中使用request对象获取数据比如从vote.asp传过来的id
可以这样取:request("id")
在asp中有两种获取数据的方法,一个是request.querystring和request.form,前面的querystring方法是用来获取例如像:index.asp?id=4,这样传递的数据,而form是用来获取表单的元素,其取值是通过表单元素的id来完成的,不过也可以直接用request("参数名")来获取.