Forum Moderators: coopster
[google.com...]
So if I click on one of the result links they should see a referer of the above URL. You can then just parse and split out the pieces that you want.
Scott Geiger
For a description of Access Logs with Apache [httpd.apache.org].
as far as parsing the referer string to get the search phrase, maybe try either
String Functions [php.net]
or
Regular Expression Functions (Perl-Compatible) [php.net]
First, get the querystring out of the $_SERVER['HTTP_REFERER'] variable. (see: parse_url [php.net])
Next, get the name/value pairs out of the querystring. (see explode [php.net])
Then, if there's an attribute named 'q', then that's your search string from google. If it's 'p', it may be from Yahoo's google search. Check the domain of the referer to be sure.
You may want to urldecode [php.net] the search terms once you've go them.