天津蓟县长虹暖气片:怎样在首页上直接实现搜索

来源:百度文库 编辑:高考问答 时间:2024/04/30 14:22:55
我想在首页的站内搜索旁写上文字,比如:农业 工业 服务业,然后点击某一个就可以到达文章标题包含这个词的搜索页面,就象在站内搜索填上某个词点击搜索后的结果一样,就是不用浏览者自己往站内搜索上填词了,可以直接点击想搜索的词实现搜索,请问首页上代码应该怎样写,最好能直接给写出来,不胜感谢。
原首页站内搜索的asp如下;
<td align=center height=26 >
<form method="post" action="so.asp">站内搜索:
<input type="radio" name="sotype" value="1" checked>标题
<input type="text" name="word" size="20" style="background-image:url('img/go.gif');background-position:center left;background-repeat:no-repeat;padding:3px 0 0 20px;height:22px;color:'#999999';COLOR: #0000ff; BACKGROUND-COLOR: #ffffff; border-bottom: #333333 1px solid; border-left: 0px; border-right: 0px; border-top: 1px; color: #333333; cursor: text; font-family: Arial; font-size: 9pt; height: 20px; value=" 请填入您的内容">
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: '[string: ""]'
/so.asp, 第 83 行
(使用<a href="so.asp?word=农业"> 农业 </a> 出现的错误)

第二个答复的恐怕还不行.
在so.asp文件中
request.querystring和request.form得到的结果不一样滴
原来的so.asp文件中肯定是request.form("word")
你这个so.asp?word="农业"是传递补不过去的
得在so.asp文件中做一定修改
if request.form("word")="" then
temp=request.querystring("word")
else
temp=request.form("word")
end if

<a href="so.asp?word=农业"> 农业 </a>

就是一个连接就行了!!

word类型与农业不匹配,请查看数据库中word的更改类型

SQL语句中where word="&request("word")
where word='"&request("word")&"'"

安个网络实名

安个网络实名 不错