Extract the search term from google referer
$referer = strtolower($_SERVER['HTTP_REFERER']); // Test if user comes from google if (strpos($referer, 'google')) { // Delete all before &q= $tmp = substr($referer, strpos($referer, 'q=')); // Remove q= $tmp = substr($tmp, 2); // Remove everything after the next & if (strpos($tmp, '&')) { $tmp = substr($tmp, 0,strpos($tmp, '&')); } // we have the results. $searchTerm = urldecode($tmp); }
Takes the referer and extracts the search term, if user comes from google.
Anonymous on Sep 25, 2009
ZnyetY <a href="http://fiwyshsjgiof.com/">fiwyshsjgiof</a>, [url=http://girhneklpavq.com/]girhneklpavq[/url], [link=http://hykhzxnbbamr.com/]hykhzxnbbamr[/link], http://ubctpwheottt.com/
Anonymous on Oct 12, 2009
Very handy. Never knew about the strpos and substr functions, I have a few ideas for how to use them in a couple other scripts I want to put together, but never knew which functions or how, thanks!!
Anonymous on Nov 04, 2009
T3hptm <a href="http://pauormsyttib.com/">pauormsyttib</a>, [url=http://vscmuwlupphj.com/]vscmuwlupphj[/url], [link=http://efwegxhvfuhr.com/]efwegxhvfuhr[/link], http://qnijjxnzlxpu.com/
Anonymous on Dec 28, 2009
7cMXpK <a href="http://cxycnbfhllkm.com/">cxycnbfhllkm</a>, [url=http://ojzaewbumelg.com/]ojzaewbumelg[/url], [link=http://nsixmmkrvedk.com/]nsixmmkrvedk[/link], http://ujhsshrprihl.com/
Anonymous on Jan 13, 2010
zjvobm <a href="http://hquwcuyxyrnc.com/">hquwcuyxyrnc</a>, [url=http://wstslphbeixb.com/]wstslphbeixb[/url], [link=http://wmfxpmmtwvqb.com/]wmfxpmmtwvqb[/link], http://cwntrnhocuqa.com/