PHP HELP | if ($_GET['url'] == "facebook.com").....

Discussion in 'PHP' started by ChristopherLeeMaher.Com, Oct 28, 2010.

  1. #1
    Hello,
    I am making a script and I am a little bit stuck
    <?php
    if ($_GET['url']; == "facebook.com") {header("Location: /bblocker/browse.php?u=http://facebook.com/");};
    if ($_GET['url']; == "youtube.com") {header("Location: /glype/browse.php?u=http://youtube.com/");};
    else{}
    ?>
    PHP:
    I want it so if someone enters facebook.com or even any facebook url like http://apps.facebook.com/digitalpoint/ it redirects them to /bblocker/browse.php?u=(the url)

    and for youtube the same exapt it redirects them to /glype/browse.php?u=(the url)

    and if its not youtube or facebook it redirects them to /global/?u=(the url)

    Thanks,
     
    ChristopherLeeMaher.Com, Oct 28, 2010 IP
  2. silviuks

    silviuks Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try something like:
    if(strstr($_GET['url'], 'facebook.com'))
    PHP:
     
    silviuks, Oct 28, 2010 IP
  3. kasun0777

    kasun0777 Well-Known Member

    Messages:
    355
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    138
    #3
    it is working for https.
    Thanks
     
    kasun0777, Oct 28, 2010 IP