CliffLandin
Programmer
Okay, I was practicing my postgresql dbase programming when I ran into a problem. Not postgres problem a php problem.
The problem is:
Using php/html I create a form with the user information. So I check to see that all required fields are filled in using something similar to
<code>
$user = $_POST['uname'];
// verify USERNAME is valid
// if USERNAME BLANK redirect with error #4
if (empty($user))
header("Location: index.php?err=4");
</code>
No matter whether their is something posted or not this check never gets done. It does the next check, which is to check the dbase usernames. It comes back as 'User not found!'
Why doesn't this work? This is the example of empty from the PHP site:
<code>
$var = 0;
// Evaluates to true because $var is empty
if (empty($var)) {
echo '$var is either 0, empty, or not set at all';
}
</code>
Thanks for any help,
When in doubt, go flat out!
The problem is:
Using php/html I create a form with the user information. So I check to see that all required fields are filled in using something similar to
<code>
$user = $_POST['uname'];
// verify USERNAME is valid
// if USERNAME BLANK redirect with error #4
if (empty($user))
header("Location: index.php?err=4");
</code>
No matter whether their is something posted or not this check never gets done. It does the next check, which is to check the dbase usernames. It comes back as 'User not found!'
Why doesn't this work? This is the example of empty from the PHP site:
<code>
$var = 0;
// Evaluates to true because $var is empty
if (empty($var)) {
echo '$var is either 0, empty, or not set at all';
}
</code>
Thanks for any help,
When in doubt, go flat out!