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, below are some of the main search engines I have collected (Google, Baidu, Yahoo)CodeYou only need to replace "www.william long.info" 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.william long.info">
<Input type = hidden name = sitesearch value = "www.william long.info">
</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.william long.info">
</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.william long.info">
</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.william long.info & sitesearch = www.william long.info & 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.william long.info & 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 -->
Note: all of the above content comes from the use of accumulated Internet learning materials.