View Single Post
Old 03-19-2008, 05:34 PM   #7 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
POST data is sent when you submit a form (usually by pressing on a button labelled "Submit" or "Login" or somesuch) with the "action=POST" property. If you simply load up a PHP page, the $_POST array will be empty because no form has been submitted.

So, if you go to your "TMPh1hlhxx6mm.php" file in your browser, you haven't actually submitted any POST data, and $_POST is empty. However, your script assumes it isn't. For instance, look at the following statement you have on line 11:
Quote:
if($_POST["username"])
$_POST["username"] does not exist - the $_POST array is empty. PHP gives you an error and the "if" statement fails.

Likewise, if this is the first time you have accessed this page, no session variables have been set. So the following elseif:
Quote:
elseif($_SESSION["username"])
will likewise fail, because $_SESSION is empty. And if both clauses fail, $username and $password are never set.
__________________
GitS
Belisarius is offline   Reply With Quote