< td height="2" width="31%" >
< div align="right" >请选择你使用的搜索引擎: < /div >
< /td >
< td height="2" width="69%" >
< input type="checkbox" name="yeah" value="yeah" >
Yeah
< input type="checkbox" name="yahoo" value="yahoo" >
Yahoo
< input type="checkbox" name="sina" value="sina" >
Sina
< input type="checkbox" name="sohu" value="sohu" >
Sohu
< input type="checkbox" name="goyoyo" value="goyoyo" >
Goyoyo< /td >
< /tr >
< tr >
< td height="2" colspan="2" >
< div align="right" >
< input type="submit" name="Submit" value="让我们开始吧" class="test1" >
< /div >
< /td >
< /tr >
< /table >
< /form >
< /td >
< /tr >
< tr bordercolor="#FFFFFF" >
< td height="20" >备注:由于使用了多个搜索引擎检索,所以系统输出的时间较长,请耐心等待... ...< /td >
< /tr >
< tr bordercolor="#FFFFFF" >
< td height="20" >
< div align="center" >建议使用 IE 5.x 800*600访问 ASPCN.COM 版权保留(2000-2001) < font size="2" >©< /font >< /div >
< /td >
< /tr >
< /table >
< /body >
< /html >
< !--
页面代码显示结束
数据处理代码显示
-- >
< %else
Server.ScriptTimeout = 100’设置脚本时间,由于系统输出时间较长所以必须修改脚本代码执行时间
Set http = Server.CreateObject("AspHTTP.Conn")’连结组件
keyword=request.form("keyword")’取得搜索关键字
if request.form("yeah")="yeah" then’判断是否选择使用yeah搜索引擎
http.Url = "http://search.163.com/cgi-bin/search/engine/search.fcgi?key="&keyword’处理搜索地址
http.RequestMethod = "GET"’设置取得数据方式"GET,取得数据"
response.write http.geturl’输出搜索结果
end if
’以下代码请参考上例的说明。
’使用yahoo
if request.form("yahoo")="yahoo" then
http.Url = "http://google.yahoo.com/bin/query_gb?p="&keyword
http.RequestMethod = "GET"
response.write http.geturl
end if
’使用sohu
if request.form("sohu")="sohu" then
http.Url ="http://search.sohu.com/cgi-bin/search_main.cgi?txt_keyword="&keyword&"&page_index=0&fuzzy=0&catagory=main"
http.RequestMethod = "GET"
response.write http.geturl
end if
’使用goyoyo
if request.form("goyoyo")="goyoyo" then
http.Url ="http://www.goyoyo.com.cn/gyy/query?dbs=guidedbs&code=GB&query="&keyword
http.RequestMethod = "GET"
response.write http.geturl
end if
set http=nothing
end if
’提交数据处理结束
% >
责任编辑:小草