功能:当网页指向http://game1.zj.vnet.cn/url1.php?MT=时,自动转向百度搜索(需要自己修改host文件中的game1.zj.vnet.cn为127.0.0.1,然后把这个文件命名为url1.php放到相关目录下)
直接输入关键词转到百度搜索
使用b+空格+关键词转到百度搜索
使用bi+空格+关键词或者i+空格+关键词转到百度图片搜索
使用bm+空格+关键词转到m+空格+关键词百度音乐搜索
使用map+空格+关键词转到百度地图搜索
使用g+空格+关键词转到Google搜索
使用gi+空格+关键词转到Google图片搜索
下载的zip里面就是这个程序,给出源码:
<?php
$MT=$_GET['MT'];
$wd=$_GET['wd'];
if(empty($wd))$wd=$MT;
$wd=str_replace('\"','"',$wd);
$wd_g=@iconv("utf-8","gb2312",$wd);
$wd=urlencode($wd);
$wd_g=urlencode($wd_g);
if(substr($wd_g,0,4)=="map+")
{$wd_g=substr($wd_g,4,strlen($wd_g)-4);
header ("Location:http://map.baidu.com/#ct=10&word=".$wd_g);
exit;}
if (substr($wd,0,3)=="gi+")
{$wd=substr($wd,2,strlen($wd)-2);
header ("Location:http://images.google.com/images?q=".$wd);
exit;}
if (substr($wd,0,2)=="g+")
{$wd=substr($wd,2,strlen($wd)-2);
header ("Location:http://www.google.com/search?meta=lr%3Dlang_zh-CN&q=".$wd);
exit;}
if (substr($wd,0,2)=="b+")
{$wd=substr($wd,2,strlen($wd)-2);
header ("Location:http://www.baidu.com/s?ie=UTF-8&wd=".$wd);
exit;}
if(substr($wd_g,0,2)=="m+")
{$wd_g=substr($wd_g,2,strlen($wd_g)-2);
header ("Location:http://mp3.baidu.com/m?ct=134217728&word=".$wd_g);
exit;}
if(substr($wd_g,0,2)=="i+")
{$wd_g=substr($wd_g,2,strlen($wd_g)-2);
header ("Location:http://image.baidu.com/i?cl=2&lm=-1&ct=201326592&word=".$wd_g);
exit;}
if(substr($wd_g,0,3)=="bm+")
{$wd_g=substr($wd_g,3,strlen($wd_g)-3);
header ("Location:http://mp3.baidu.com/m?ct=134217728&word=".$wd_g);
exit;}
if(substr($wd_g,0,3)=="bi+")
{$wd_g=substr($wd_g,3,strlen($wd_g)-3);
header ("Location:http://image.baidu.com/i?cl=2&lm=-1&ct=201326592&word=".$wd_g);
exit;}
else
{header ("Location:http://www.baidu.com/s?ie=UTF-8&wd=".$wd);
exit;}
?>