_POST variable only visible to the program after I print it?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gloriajw
    New Member
    • Sep 2006
    • 1

    _POST variable only visible to the program after I print it?

    This is an odd problem.

    My _POST['email'] variable is always set. But it is not visible to this function until I do a print_r($_POST) ; No matter where I do this in the file, even if it's within the 'if' clause, it causes my program to see the _POST array. Once I remove it, I fall into the else clause.

    My code is simple:

    function doUserAuth($db)
    {
    global $cookieDomain;

    if(isset($_POST['email']))
    {
    $p_email=strtol ower($_POST['email']);
    $p_password=$_P OST['password'];
    }
    else
    {
    print "Error!!!";
    }
    }

    Odd, eh? have I hit som obscure PHP bug? I'm running PHP 4.3.9 pre-built for the RHE version 2.6.9-42.ELsmp.

    Thank you in advance,
    Gloria
  • vssp
    Contributor
    • Jul 2006
    • 268

    #2
    Hi first store the POST value one variable and declare the global variable insde the functioon and check the codeing its working fine

    Comment

    Working...