<html>
<head>
<title>...</title>
</head>
<body>
<%
keyword=split(request.form("textfield")) '用空格將多個關鍵字分隔,並儲存在keyword數組中
str=""
for i=0 to ubound(keyword) 'ubound函數獲得數組最大下標值,將多個關鍵字用“+”號連結
if i=ubound(keyword) then
str=str&keyword(i)
else
str=str&keyword(i)&"+"
end if
next
if request.form("select")="搜狐" then '選擇“搜狐”
response.redirect("http://search.sohu.com/web?query="&str) '轉到搜狐搜尋使用者關鍵字的網頁
'http://search.sohu.com/web?query=asp+%cb%d1%cb%f7%d2%fd%c7%e6&radiobutton=0
end if
if request.form("select")="新浪" then '選擇“新浪”
response.redirect("http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="&str) '轉到新浪搜尋使用者關鍵字的網頁
'http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey=asp++%cb%d1%cb%f7%d2%fd%c7%e6
end if
if request.form("select")="百度" then '選擇“百度”
response.redirect("http://www.baidu.com/s?cl=3&wd="&str) '轉到百度搜尋使用者關鍵字的網頁
end if
%>
</body>
</html>