Re: $_POST["mypassword"]; ***Undefined index: mypassword

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/14/07, Chetanji <chetan_graham@xxxxxxxxxxxxxx> wrote:

Thanks for the reply,  this is the only output before and after the
$_POST....

              array(0) { } ......that's it

I still have the two Notice's from PHP.
But the program works otherwise, in checking the DB for the hashed
password...
that matches the typed in username ...
that is then hashed itself
in the login.php program.
It works and doesn't 'auth' for incorrect user/pass combinations.
However, I do not like running programs that kick out 'errors' of any kind.
It seems to always lead to unpredictable situations that are a problem.
Any other ideas?
Thanks,
Chetanji

Well then the $_POST array is empty that's why you have those notices.
The $_POST array is populated with values ONLY after the form was
submitted to the login.php script.
If you use this script before the form was submitted or in any other
context, then you will get those notices.

If you check if the variables you are looking for are set, before
assigning them, you will not get the notices.

Try this:
if(isset($_POST["myusername"] AND isset($_POST["mypassword"])){
$myusername=$_POST["myusername"];
$mypassword=$_POST["mypassword"];
}

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux