www.webdeveloper.com
Results 1 to 5 of 5

Thread: $_GET, $_POST, $_REQUEST - Problems with Globals on/off??

  1. #1
    Join Date
    Dec 2006
    Posts
    48

    $_GET, $_POST, $_REQUEST - Problems with Globals on/off??

    Hi,
    I currently have a webspace on my College's website and want to use PHP to do some stuff, like passing variables from page to page. For this, I use all the common stuff like $_GET and $_POST. However, on the school server, $_GET and $_POST don't seem to work. Could this be because they have different settings for the Register Globals or something? Am i supposed to pass these variables in some other, more secure way? The server is running PHP 4.2.2, by the way. Thanks!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,921
    The super-globals ($_GET, $_POST, etc.) were introduced in PHP 4.1.0, and so should be available. register_globals being on or off should have no effect on those arrays (which is why they should be used instead of depending on register_globals). So based on the information at hand, I do not know why you're having a problem.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Dec 2006
    Posts
    48
    I tried printing out $_SERVER['QUERY_STRING'] and it's blank, but if i print out $_SERVER['HTTP_REFERER'] it shows the URL and the variables in it.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,921
    Most of the $_SERVER variables are largely dependent upon the web server to set them, so generally speaking none are absolutely guaranteed to be set in any given installation. To see which ones are being set on your server, you could do:
    PHP Code:
    <?php
    echo "<pre>".print_r($_SERVER1)."</pre>";
    ?>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Dec 2006
    Posts
    48
    ha, it just started working, by itself, i swear the server must hate me or something. I changed nothing and refreshed the page and BAM, it works :\

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles