Home > php教程 > PHP源码 > body text

php站内搜索

PHP中文网
Release: 2016-05-25 17:13:06
Original
1243 people have browsed it

[PHP]代码 

<!--Google站内搜索开始-->  
<form method=get action="http://www.google.com/search">  
<input type=text name=q>  
<input type=submit name=btnG value="Google 搜索">  
<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.williamlong.info">  
<input type=hidden name=sitesearch value="www.williamlong.info">  
</form>  
<!--Google站内搜索结束-->  
  
<!--Baidu站内搜索开始-->  
<form action="http://www.baidu.com/baidu">  
<input type=text name=word>  
<input type="submit" value="Baidu 搜索">  
<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.williamlong.info">  
</form>  
<!--Baidu站内搜索结束-->  
  
<!--Yahoo站内搜索开始-->  
<form action="http://www.yahoo.com.cn/search">  
<input type=text name="p">  
<input type="submit" value="Yahoo 搜索">  
<input type=hidden name=vs value="www.williamlong.info">  
</form>  
<!--Yahoo站内搜索结束-->  
  
  下面是Google和百度的Javascript版的站内搜索代码:  
  
<!--Google站内搜索开始-->  
<script type="text/javascript">   
function googlesearch () {  
var wq=document.getElementsByName("wq")[0].value;  
var link="http://www.google.com/search?domains=www.williamlong.info&sitesearch=www.williamlong.info&q="+wq;  
window.open(link); }  
</script>  
<input type="text" name="wq"/><input type="submit" onclick="javascript:googlesearch()" value="Google 搜索" />  
<!--Google站内搜索结束-->
Copy after login

                   

                   

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template