Question about php referrer

Discussion in 'PHP' started by mr_m, Jan 6, 2008.

  1. #1
    recently i had a script requires the user to put a link to its page like this one

    <script type="text/javascript" src="http://my.website.com/count/?user_website"></script>
    Code (markup):
    and so that it gets his http referrer and make sure that he didn't requested the web page from outside his website.

    so the question here is how to get the two referrers:
    -to my web page
    -and to his web page

    Thanks
     
    mr_m, Jan 6, 2008 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    not clear about what you are asking

    Can you explain more

    Regards

    Alex
     
    kmap, Jan 6, 2008 IP
  3. mr_m

    mr_m Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sorry, the title of the post is "Question about HTTP referrer".

    if my url is : www-my-com
    and my client : www-client-com

    Is there a way to get my client's http referrer?
     
    mr_m, Jan 6, 2008 IP
  4. thapame

    thapame Well-Known Member

    Messages:
    739
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    180
    #4
    use php variable $_SERVER['HTTP_REFERER']
     
    thapame, Jan 6, 2008 IP
  5. mr_m

    mr_m Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for reply

    the question is if client-com requested the page as <sc ript >

    the referrer here will be his page (as he is the referring to my script)
    or is referrer?
     
    mr_m, Jan 6, 2008 IP
  6. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #6
    What do you mean?

    Note that since the referrer is sent by the browser it cannot be relied on completely.
     
    MMJ, Jan 6, 2008 IP