So I had my site recoded to work with register_globals OFF. I need help with 1 thing.

Discussion in 'PHP' started by x0x, Feb 22, 2009.

  1. #1
    The coder is gone after he recoded the site to work with register_globals off. BUT there are some bugs that I'm trying to fix....

    Here's one of them:

    the link:
    
      <a href="rounds.php?action=login&goto=<?=$round?>">
                              <font color=red>ENTER!</font>
                              </a>
    
    PHP:
    $action

    if($action == login){
    
    $getcode = $DB->fetch("SELECT code FROM $tab[user] WHERE id='$id'", __FILE__, __LINE__);
    $chkban = $DB->fetch("SELECT status,code FROM "."r".$goto."_".$tab[mob]." WHERE code='$getcode[code]'", __FILE__, __LINE__);
    
      if($chkban['status'] == banned){
        $DB->query("UPDATE "."r".$goto."_".$tab[mob]." SET status='banned' WHERE code='$chkban[code]'", __FILE__, __LINE__);
        }
      if($chkban['status'] != banned){
        $DB->query("UPDATE "."r".$goto."_".$tab[mob]." SET status='$chkban[status]' WHERE code='$chkban[code]'", __FILE__, __LINE__);
        }
    
    header("location: rnd/dologin.php?code=$rndmob&rnd=$goto");
    
    }
    PHP:
    It won't do what it's supposed to do when I click the link... When I turn register_globals on, it works.

    I tried to change this part "if($action == login){" to "if($_POST['action'] == "login"){", but it still didn't work.
     
    x0x, Feb 22, 2009 IP
  2. x0x

    x0x Well-Known Member

    Messages:
    510
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #2
    if($_GET['action'] == "login"){

    that fixed it. Although I don't understand why. I just blindly tried.
     
    x0x, Feb 22, 2009 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    GET gets passed via the URL.
    POST gets passed via the form.

    Peace,
     
    Barti1987, Feb 22, 2009 IP