For a website, using a search engine for intra-site search is more efficient than self-compiled intra-site search, and does not occupy the resources of the website server, the following is the intra-site search code of several major search engines I have collected (Google, Baidu, and Yahoo, you only need to replace "www.jb51.net" in the Code with your website address.
<! -- Start searching on the Google site -->
<Form method = get action = "http://www.google.com/search">
<Input type = text name = q>
<Input type = submit name = btnG value = "Google Search">
<Input type = hidden name = ie value = GB2312>
<Input type = hidden name = oe value = GB2312>
<Input type = hidden name = hl value = zh-CN>
<Input type = hidden name = domains value = "www.jb51.net">
<Input type = hidden name = sitesearch value = "www.jb51.net">
</Form>
<! -- Google site search ends -->
<! -- Baidu Site Search Start -->
<Form action = "http://www.baidu.com/baidu">
<Input type = text name = word>
<Input type = "submit" value = "Baidu search">
<Input name = tn type = hidden value = "bds">
<Input name = cl type = hidden value = "3">
<Input name = ct type = hidden value = "2097152">
<Input name = si type = hidden value = "www.jb51.net">
</Form>
<! -- Baidu intra-site search ends -->
<! -- Start searching on the Yahoo site -->
<Form action = "http://www.yahoo.com.cn/search">
<Input type = text name = "p">
<Input type = "submit" value = "Yahoo Search">
<Input type = hidden name = vs value = "www.jb51.net">
</Form>
<! -- Yahoo website search ended -->
The following is the site search code for Google and Baidu's Javascript version:
<! -- Start searching on the Google site -->
<Script type = "text/javascript">
Function googlesearch (){
Var wq = document. getElementsByName ("wq") [0]. value;
Varlink = "http://www.google.com/search? Domains = www.jb51.net & sitesearch = www.jb51.net & q = "+ wq;
Window. open (link );}
</Script>
<Input type = "text" name = "wq"/> <input type = "submit" onclick = "javascript: googlesearch ()" value = "Google Search"/>
<! -- Google site search ends -->
<! -- Baidu Site Search Start -->
<Script language = "javascript">
Function baidusearch (){
Var wd = document. getElementsByName ("wd") [0]. value;
Var link = "http://www.baidu.com/s? Si = www.jb51.net & cl = 3 & ct = 2097152 & tn = baidulocal & word = "+ wd;
Window. open (link );}
</Script>
<Input type = "text" name = "wd"/> <input type = "submit" onclick = "javascript: baidusearch ()" value = "Baidu search"/>
<! -- Baidu intra-site search ends -->