PHP Jump Script not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moeloubani
    Confirmed User
    • Dec 2007
    • 4235

    #1

    PHP Jump Script not working

    Why isn't this working? I'm linking to ?m=a and its going to the blank one every time

    Code:
    <?php
    if ($m == "b") {$link = "http://siteb.com";}
    if ($m == "c") {$link = "http://siteb.com";}
    if ($m == "a") {$link = "http://siteb.com";}
    if ($m == "") {$link = "http://siteb.com";}
    header("Location: $link");
    exit();
    ?>
  • Sands
    Confirmed User
    • Feb 2007
    • 3134

    #2
    Originally posted by moeloubani
    Why isn't this working? I'm linking to ?m=a and its going to the blank one every time

    Code:
    <?php
    if ($m == "b") {$link = "http://siteb.com";}
    if ($m == "c") {$link = "http://siteb.com";}
    if ($m == "a") {$link = "http://siteb.com";}
    if ($m == "") {$link = "http://siteb.com";}
    header("Location: $link");
    exit();
    ?>
    Is there something in there that's grabbing the url variable that's designating the link, but you've left it out of the snippet you've pasted? Like:

    Code:
    $m = $_GET['m'];
    Or something to that effect. If that's not there, it should be as that's what will bring the "a" value into that snippet.
    Last edited by Sands; 03-20-2010, 12:47 AM.

    Comment

    • moeloubani
      Confirmed User
      • Dec 2007
      • 4235

      #3
      thanks homie!!

      Comment

      Working...