SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: HTTP_REFERER

  1. #1
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok guys.. im totally stumped.. for some reason HTTP_REFERER isnt working This is my code

    $refer = getenv("HTTP_REFERER");
    $browser = getenv("HTTP_USER_AGENT");
    $ip = $REMOTE_ADDR;
    echo ("$refer , $ip, $browser");


    it echoes everything but the referer url.. you can test it at
    http://www.getmonked.net/test.php

    is there any other way, i can find out the domain that refered my site? basically, i am running custom logs
    i dunno...

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see you've got it working

    http://www.sitepointforums.com/showt...threadid=20240 , 61.9.192.142, Mozilla/5.0 (Macintosh; N; PPC; en-US; 0.8.1) Gecko/20010326

  3. #3
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm.... this is odd.. it doesnt seem to be working for me..

    this is some additional code to just get the domain name

    $refer = getenv("HTTP_REFERER");
    $browser = getenv("HTTP_USER_AGENT");
    $ip = $REMOTE_ADDR;
    $doma = ereg_replace("http://","",$refer);
    $domai = ereg_replace("/","",$doma);
    $domain = ereg_replace("www.","",$domai);
    echo ("$refer , $ip, $browser");
    echo "<br>Domain name :: $domain<br>";
    Last edited by kunal; Apr 5, 2001 at 03:39.
    i dunno...

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that there are some browsers which don't send the HTTP_REFERER header. You would have to check the documentation at www.php.net

  5. #5
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is there any other way to do this?? i couldnt find any with php
    i dunno...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •