Finding the referrer - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Finding the referrer

Anthony@SFCAnthony@SFC Posts: 11Member
Can I use PHP to find out which webpage a surfer was at before mine ??

Specifically I'd like to know if the surfer found me from a search engine, and what search terms they used.

I know webalizer can retrieve this info from log files, but the info does not seem to be available to PHP.

Surely I am missing something obvious ??


Anthony@SFC
Webmaster
[b]www.stuff-for-computers.co.uk[/b]

Comments

  • ManningManning Posts: 1,621Member
    : Can I use PHP to find out which webpage a surfer was at before mine ??
    :
    : Specifically I'd like to know if the surfer found me from a search engine, and what search terms they used.
    :
    : I know webalizer can retrieve this info from log files, but the info does not seem to be available to PHP.
    :
    : Surely I am missing something obvious ??

    I believe $_SERVER['HTTP_REFERER'] is what you're after. The referring information is provided by the client, which may choose not to provide it (or may choose to provide false info -- this seems to be a new way people are advertising their website). So it's not going to be 100% accurate, but the best you can do.
Sign In or Register to comment.