homepage Welcome to WebmasterWorld Guest from 54.237.95.6
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Key word grabber?
In PHP
circuitjump




msg:1263930
 8:52 pm on Jul 25, 2001 (gmt 0)

Hi all,
I was just thinking of building an app with PHP. What it's supposed to do is check and see if the user that just accessed the site has been reffered from a search engine or not. If they are from an SE, then check and see what keywords they used to find us and log the site and keywords for later viewing.

How difficult will this be if at all possible?

Thanks

 

sugarkane




msg:1263931
 9:06 am on Jul 26, 2001 (gmt 0)

I've done something similar to this before. Sorry I don't have a snippet on hand, but the basic idea is:

Get the referrer using $HTTP_REFERER
use the ereg() function to check for a search engine
use ereg_replace() or preg_replace() to parse out the keywords

The biggest problem can be finding the right regex to use to get the keywords out of the referral string, but the actual script would be fairly straightforward.

circuitjump




msg:1263932
 2:28 pm on Jul 26, 2001 (gmt 0)

Thanks for the pointers, they are gonna come in handy as soon as I start with this.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved