Hello,
I have a client that would like me to write a PHP application that will capture the terms that were searched for from the referrer (ie google) and then send that information to administration when they submit a contact form. Enabling them to automatically know which search term has resulted in the form submission.
I know log analyzers such as awstats etc is able to track what search terms brought traffic to the site. My question is:
How can I capture this information with PHP?
Any help is greatly appreciated!
Captured Searched Terms with PHP?
Moderator: General Moderators
- uberdragon
- Forum Newbie
- Posts: 11
- Joined: Thu Apr 27, 2006 8:54 am
- Location: Farmington, CT
If it's set, $_SERVER['HTTP_REFERER'] will contain the URI of the referring page.
php.net wrote:'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- uberdragon
- Forum Newbie
- Posts: 11
- Joined: Thu Apr 27, 2006 8:54 am
- Location: Farmington, CT
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
A function similar to parse_url()?uberdragon wrote:Ah.. just tested it...
Atleast with google the search parameters are in the string that will work.
Now to write a function to parse the url