提高转化率利器,将来源关键词到天猫的关键词,
<?PHP if(!empty($_GET['url'])){ $url=$_GET['url']; if(strpos($url,"baidu.com") != 0){ //var_dump($url); $url_query = substr(strstr($url,'?'),1); //var_dump($url_query); parse_str($url_query,$output); //var_dump($output); if($output['ie']!='utf-8'){ $page_c = file_get_contents($url); preg_match("/\<title\>(.*)\<\/title\>/",$page_c,$matches); $k=$matches[1]; }elseif(!empty($output['wd'])){ $k=$output['wd']; }elseif(!empty($output['word'])){ $k=$output['word']; }else{ $k="情侣装1"; } }elseif(strpos($url,"so.360.cn") != 0 || strpos($url,"so.com") != 0 ){ $url_query = substr(strstr($url,'?'),1); parse_str($url_query,$output); if(!empty($output['q'])){ $k=$output['q']; }else{ $k="情侣装2"; } }else{ $k="情侣装3"; } $k = str_replace("_百度搜索","",$k); $k = str_replace("商城","",$k); $k = str_replace("旗舰店","",$k); $k = str_replace("官网","",$k); $k = str_replace("吧","",$k); $k = str_replace("交流","",$k); $k = str_replace("论坛","",$k); $k = str_replace("中国","",$k); $k = str_replace("网","",$k); $k = str_replace("及","",$k); $k = str_replace("官方","",$k); $k = str_replace("txt","",$k); $k = str_replace("之","",$k); }else{ $k='kongkong'; } ?> <script type="text/javascript" src="http://mmloves.xjg1.com/js/jquery.min.js"></script> <script type="text/javascript"> $("#document").ready(function(){ var k="<?PHP echo $k; ?>"; if(k != 'kongkong' ){ $("#searchtext2").val(k); $("form").submit(); } }); </script>
转化率老高了。