*/ --------------------------------------------------------------------------------------
*/ 出自: 编程中国 http://www.bc-cn.net
*/ 作者: yanguorui
*/ 时间: 2007-7-11 编程论坛首发
*/ 声明: 尊重作者劳动,转载请保留本段文字
*/ --------------------------------------------------------------------------------------
查询表单的内容:
<form method="POST" action="act_select.asp">
<p><select size="1" name="tiaojian">
<option value="1">按照用户名</option>
<option value="2">按照身份证号</option>
<option value="3">按照档案号</option>
<option value="4">按照合同号</option>
</select><input type="text" name="neirong" size="20"><input type="submit" value="确定" name="B3"></p>
</form>
处理部分:
<%
tiaojian=request("tiojian")
neirong=request("neirong")
Set rs = Server.CreateObject("ADODB.Recordset")
Sql="select * from info"
rs.open sql, conn, 1, 1
if tiaojian=1 then
Sql="select * from info where username='"&neirong&"'"
rs.open sql, conn, 1, 1
user_id=rs("user_id")
response.redirect "show_userinfo.asp?user_id="&user_id&""
elseif tiaojian=2 then
Sql="select * from info where user_id='"&neirong&"'"
rs.open sql, conn, 1, 1
user_id=rs("user_id")
response.redirect "show_userinfo.asp?user_id="&user_id&""
elseif tiaojian=3 then
Sql="select * from info where user_da='"&neirong&"'"
rs.open sql, conn, 1, 1
user_id=rs("user_id")
response.redirect "show_userinfo.asp?user_id="&user_id&""
elseif tiaojian=4 then
Sql="select * from info where contractid='"&neirong&"'"
rs.open sql, conn, 1, 1
user_id=rs("user_id")
response.redirect "show_userinfo.asp?user_id="&userid&""
elseif rs.eof and rs.bof then
Response.write "<script language=javascript>alert('查询内容不存在!!');history.go(-1);</script>"
Response.End
end if
%>
执行之后,没有错误提示,也没有参数的传递,问是什么原因,能否给改一下!