复制代码代码如下:
$rfr = $_SERVER['HTTP_REFERER'];
//if(!$rfr) $rfr='http://'.$_SERVER['HTTP_HOST' ];
if($rfr)
{
$p=parse_url($rfr);
parse_str($p['query'],$pa);
$p['host']=strto lower($p['host' ]);
$arr_sd_key=array(
'baidu.com'=>'単語',
'google.com'=>'q',
'sina.com.cn'=>'単語',
'sohu.com'=>'word',
'msn.com'=>'q',
'bing.com'=>'q',
'163.com'=>'q ',
'yahoo.com'=>'p'
);
$keyword='';
$sengine=$p['host'];
foreach($arr_sd_key as $se=>$kwd)
{
if(strpos($p['host'],$se)!==false)
{
$keyword=$pa[$kwd];
$sengine=$se;
break;
}
}
$sql="visit_log(domain,key_word,ct) に挿入";
}
http://www.bkjia.com/PHPjc/735235.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/735235.html技術記事複制代码次のように: $rfr = $_SERVER['HTTP_REFERER']; //if(!$rfr) $rfr='http://'.$_SERVER['HTTP_HOST']; if($rfr) { $p=parse_url($rfr); parse_str($p['クエリ'],$pa); $p['ホスト']=...