Page 1 of 1

How would I strip the referer to get the google search word

Posted: Thu Jan 13, 2005 9:42 am
by MrSpam
So far I have (referer is set, dont worry)

Code: Select all

$forum_propertiesї'google_log'] = 1;
	##q=keyword& - generally all searches are encased like this
function google_refers($referer)
	{global $forum_properties;
	
	if($forum_propertiesї'google_log'] == 1) {
	$address = str_replace('http://', '', $refer);
	$address = str_replace('', '', $address);
	
	
	
	}
}
Then I stopped and though that regex would be a better choice, or not?

Im just not sure how I should go about it, HELP

Posted: Thu Jan 13, 2005 9:45 am
by feyd
use both of the following functions.
http://php.net/parse_url
http://php.net/parse_str

Posted: Thu Jan 13, 2005 10:06 am
by MrSpam
Ah thanks alot :D It works excellently.