注册 登录
编程论坛 ASP技术论坛

请教关于asp的form问题

cirowong 发布于 2011-10-12 10:50, 520 次点击
有a.asp页面,上部分是条件查询form,下部分是结果显示。
  现在想点击“打印”在b.asp上也显示结果。该如何写.....  请各位大侠指教。。。

A.ASP
<!--#include file="conn.asp" -->
   <% action = request("action") %>
<FORM ......>
....'//FORM内容
<%
keyword=replace(replace(replace(replace(replace(trim(request("keyword")),"'",""),"<","("),">",")"),"&gt;",")"),"&lt;","(")
typeid=replace(replace(replace(replace(replace(trim(request("typeid")),"'",""),"<","("),">",")"),"&gt;",")"),"&lt;","(")
%>     
</FORM>
<% if action="ok"  then  %>
<%set rsstudent=server.createobject("adodb.recordset")
xsxx=1
if keyword="" then
response.redirect "admin_xxcx.asp"
end if
if typeid="" then
sqlstudent="select * from student where name like '%"&keyword&"%'  order by adid desc"
end if
if typeid="1" then
sqlstudent="select * from student where name like '%"&keyword&"%'  order by adid desc"
end if
if typeid="2" then
sqlstudent="select * from student where class like '%"&keyword&"%'  order by adid desc"
end if
if typeid="3" then
sqlstudent="select * from student where h_number like '%"&keyword&"%'  order by adid desc"
end if
if typeid="4" then
sqlstudent="select * from student where hostel like '%"&keyword&"%'  order by adid desc"
end if
if typeid="5" then
sqlstudent="select * from student where sex like '%"&keyword&"%'  order by adid desc"
end if
if typeid="6" then
sqlstudent="select * from student where Native_place like '%"&keyword&"%'  order by adid desc"
end if
if typeid="7" then
sqlstudent="select * from student where nation like '%"&keyword&"%'  order by adid desc"
end if            
if typeid="8" then
sqlstudent="select * from student where status_number like '%"&keyword&"%'  order by adid desc"
end if   
if typeid="9" then
sqlstudent="select * from student where adnumber like '%"&keyword&"%'  order by adid desc"
end if   
if typeid="10" then
sqlstudent="select * from student where tele like '%"&keyword&"%'  order by adid desc"
end if   
if typeid="11" then
sqlstudent="select * from student where admin like '%"&keyword&"%'  order by adid desc"
end if
                        
rsstudent.open sqlstudent,conn,1,1%>
<%if rsstudent.eof and rsstudent.bof then%>
               
<%response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 抱歉没有找到您想要的数据!');window.location.href='admin_xxcx.asp';</script>"%>
<%else%>
<%i=0%>
               
<%do while not rsstudent.eof or rsstudent.bof %>
  <%i=i+1%>

'<!--//显示结果。。。。
1 回复
#2
yms1232011-10-12 13:10
通过URL传参数b.asp过去呢?
1