$_POST not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scabman
    New Member
    • Dec 2006
    • 3

    $_POST not working

    Working on upgrading a site and after moving everything onto a test server (localhost) things started to get real buggy. Went through and checked all my links and everything comes up fine, but it seems that all of my $_POST variables are not reading at all. Since the code hasn't changed much over the move (just one or two paths that the previous guy did a little funny) I'm assuming that it's some sort of configuration issue. Help would be appreciated.

    Linux Fedora Core 5
    Working in PhP 5.1.2

    [PHP]
    $uname = $_POST['username'];
    $ID = $_POST['ID'];
    $pword = $_POST['password'];
    $pword_2 = $_POST['password_2'];
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $addr_1 = $_POST['addr_1'];
    $addr_2 = $_POST['addr_2'];
    $email = trim($_POST['email']);

    $phone = trim($_POST['phone']);
    $phone = str_replace("(" , "", $phone);
    $phone = str_replace(")" , "", $phone);
    $phone = str_replace(" ", "", $phone);
    $phone = str_replace("." , "", $phone);
    $phone = str_replace("-", "", $phone);

    $city = $_POST['city'];
    $state = $_POST['state'];
    $zip = $_POST['zip'];
    $type = $_POST['user_type'];
    [/PHP]

    getting these errors:

    Notice: Undefined index: username in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 5

    Notice: Undefined index: ID in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 6

    Notice: Undefined index: password in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 7

    Notice: Undefined index: password_2 in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 8

    Notice: Undefined index: first_name in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 9

    Notice: Undefined index: last_name in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 10

    so on and so on...

    Any help would go a very long way.
  • b1randon
    Recognized Expert New Member
    • Dec 2006
    • 171

    #2
    Originally posted by scabman
    Working on upgrading a site and after moving everything onto a test server (localhost) things started to get real buggy. Went through and checked all my links and everything comes up fine, but it seems that all of my $_POST variables are not reading at all. Since the code hasn't changed much over the move (just one or two paths that the previous guy did a little funny) I'm assuming that it's some sort of configuration issue. Help would be appreciated.

    Linux Fedora Core 5
    Working in PhP 5.1.2

    [PHP]
    $uname = $_POST['username'];
    $ID = $_POST['ID'];
    $pword = $_POST['password'];
    $pword_2 = $_POST['password_2'];
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $addr_1 = $_POST['addr_1'];
    $addr_2 = $_POST['addr_2'];
    $email = trim($_POST['email']);

    $phone = trim($_POST['phone']);
    $phone = str_replace("(" , "", $phone);
    $phone = str_replace(")" , "", $phone);
    $phone = str_replace(" ", "", $phone);
    $phone = str_replace("." , "", $phone);
    $phone = str_replace("-", "", $phone);

    $city = $_POST['city'];
    $state = $_POST['state'];
    $zip = $_POST['zip'];
    $type = $_POST['user_type'];
    [/PHP]

    getting these errors:

    Notice: Undefined index: username in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 5

    Notice: Undefined index: ID in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 6

    Notice: Undefined index: password in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 7

    Notice: Undefined index: password_2 in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 8

    Notice: Undefined index: first_name in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 9

    Notice: Undefined index: last_name in /var/www/html/atlbiomed/scheduler/user_manager.ph p on line 10

    so on and so on...

    Any help would go a very long way.
    Did you change from php4 to php5? I looked a the differences a while back and I know for sure that the POST data is handled differently between the two. Could that be causing your issues?

    Comment

    • scabman
      New Member
      • Dec 2006
      • 3

      #3
      Originally posted by b1randon
      Did you change from php4 to php5? I looked a the differences a while back and I know for sure that the POST data is handled differently between the two. Could that be causing your issues?
      no, the other system is running the same system. The guidelines have changed, but I checked the syntax and everything there seems up to spec.

      Comment

      • scabman
        New Member
        • Dec 2006
        • 3

        #4
        Actually, it looks like none of my superglobals are working. my $_SESSION, $_GET, and $_REQUEST all seem unresponsive. Is this perhaps an issue with PEAR?

        Comment

        Working...