我有一个这样的页面 http://abc.php
网友是从百度搜索 国家 我网站排在第三名,
所以网友就进我们网站了
现:我能得到 网友进我们网站的来源页面,
问 如何得到 网友在百度中输入的关键词(国家)呢,
在线等,多谢大家

解决方案 »

  1.   

    這個恐怕很難....
    你能得到上一個頁面的url但是你能得到百度的url???
      

  2.   

    function gather_key_content()
    {
            $gather_url="http://www.baidu.com/s?wd=%CF%F3%BA%FE2008&tn=ylmf_3_pg&ch=23";
    $has_cn= (preg_match('/baidu.com+/',$gather_url) ?'':'不').'存在';
    if($has_cn=='存在')

        $html = @file_get_contents($gather_url);
    $table = preg_replace("'<table[^>]*?>'si","",$html);
    $table = preg_replace("'<tr[^>]*?>'si","",$table);
    $table = preg_replace("'<td[^>]*?>'si","",$table);
    $table = str_replace("</tr>","{tr}",$table);
    $table = str_replace("</td>","{td}",$table);
    //去掉 HTML 标记
    $table = preg_replace("'<[\/\!]*?[^<>]*?>'si","",$table);
    //去掉空白字符 
    $table = preg_replace("'([\r\n])[\s]+'","",$table);
    $table = str_replace(" ","",$table);
    $table = str_replace(" ","",$table);
    if($table)

     $table = explode('body', $table);
     $table = explode('_', $table[0]);
    }
    echo $table[1];
    }
    }
    gather_key_content();