sever problem $_GET $_POST etc

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    sever problem $_GET $_POST etc

    Does anybody know why a server would be not collecting $_GET`s or $_POSTS etc?
    eg:
    PHP Code:
    echo "<a href=\"index.php?hello=hello&amp;world=world\">Same Page</a><br/>";
    $text "Debug: ".$_GET['hello']."=".$_GET['world'];
    echo 
    $text;
    //out come is:  Debug: = 
    I know an answer would be to register globals on but its not a good answer :/

    #2
    like this ?
    PHP Code:
    echo "<a href=\"index.php?hello=hello&amp;world=world\">Same Page</a><br/>";
    @
    $hello $_GET['hello'];
    @
    $world $_GET['world'];
    $text "Debug: ".$_GET['hello']."=".$_GET['world'];
    echo 
    $text;
    //out come is:  Debug: = 
    It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
    ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
    ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
    キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

    Comment


      #3
      i havent tried using "@" to show the error as this problem is not happening with my pc but is on my friends pc (and some peoples phones) so im trying to work blind :/ - but i will try this thankyou

      even with using $hello = $_GET['hello']; doesnt work.....
      however filtering it through mysql_escape_string() seems to work, which is all well and good but will cause silent errors when the variables are not going into the databse.....

      Also mysql_escape_string() doesnt help me for things like $_FILE which is also returning blank

      im wondering if i have done something wrong in one of my scripts that has changed something in php.ini
      I have spoken to the hosts about this and they seem to have no clue why this would be happening and to be honest i dont think they believe me as it works fine for them like it does for me :/

      Comment


        #4
        Because globals needs to be checked if its isset and not null, either wit isset() or empty().
        The easy way is ternary:
        PHP Code:
        $hello = isset($_GET['hello']) ? $_GET['hello'] : null
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment

        Working...
        X