1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I have a php question

Discussion in 'PHP & Perl' started by springer98, Jan 9, 2009.

  1. springer98

    springer98 Regular Member

    Joined:
    Dec 6, 2008
    Messages:
    211
    Likes Received:
    250
    Occupation:
    We doeneeeeed no stinkin' yob!
    Location:
    ZRF
    I just got this script and was poking around inside, to see what was in it, and noticed this

    Code:
    <?php
    
    if(!$_SERVER['HTTP_REFERER']){
    	
    header("Location: http://www.some-random-url-here.com");
    and I wondered why it's there and what it might do? It's a url to a youtube video that is totally unrelated to what the script is about. The exact same line is also embedded into an image file within the same package.

    I'm pretty new to php and don't have a clue why it's in there. What might happen if I change it?

    If anyone can help me out, I'd appreciate it.
     
  2. Barbacamanitu

    Barbacamanitu Jr. VIP Jr. VIP Premium Member

    Joined:
    May 8, 2008
    Messages:
    500
    Likes Received:
    91
    that will redirect to a url if the referrer is blank.
    That means if you access it directly, you will be taken to the YT url.
     
    • Thanks Thanks x 1
  3. springer98

    springer98 Regular Member

    Joined:
    Dec 6, 2008
    Messages:
    211
    Likes Received:
    250
    Occupation:
    We doeneeeeed no stinkin' yob!
    Location:
    ZRF
    Oh. Thanks for the quick response. I really appreciate it!
     
  4. Barbacamanitu

    Barbacamanitu Jr. VIP Jr. VIP Premium Member

    Joined:
    May 8, 2008
    Messages:
    500
    Likes Received:
    91
    No problem man, glad to help out. :]