网络编程
位置:首页>> 网络编程>> Asp编程>> asp如何制作一个搜索引擎链接程序?

asp如何制作一个搜索引擎链接程序?

  发布时间:2010-07-07 12:26:00 

标签:搜索引擎,asp

如何制作一个搜索引擎链接程序?

多收集几个网站的,然后我们引用它到自己的页面中。

接下来,我们要创建页面用于搜索:

<center>
<form action="web_search.asp" method="post">
<select name="selEngines">
  <option value="yahoo">雅虎快找!</option>
  ...
</select>
<input type="text" name="txtSearchWords" size="30">
<input type="submit" name="btnSearch" value="搜索">
</form>
</center>

 可以看到,当列出搜索引擎的查询字符串时,那些搜索字符变成了蓝色,这就要输入到我们的文本框strSearchWords的值,再用一个带Response.Redirect的If...Then语句重定向到用户所选择的搜索引擎中去。如果有多个搜索引擎,我们要为其中的每一个编写如下代码:

If Request.Form("selEngines") = "yahoo" Then
  Response.Redirect("http://search.yahoo.com/bin/search?p=" & _
                    Request.Form("txtSearchWords"))
End If


    好了。

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com