Disappearing usernames, anyone?
Posted: Tue Jan 02, 2007 12:37 pm
Hello there. I've gotten far in my PHP code but am stuck here. :O Check this out.
Now I've tried to see if it was being assigned correctly (the $username) and right under the _POST I've tested it to echo, and it works. So it makes me wonder if one piece of the following code is blanking it out. As in, setting it to " ".
Even if they have the wrong validation code, it'll say "Sorry, , it seems" thus showing it is blank'd by something. Also the validation checker I'm pretty sure is wrong, and I'm also pretty sure it's wrong cuz it blanks it. 
Now I've tried to see if it was being assigned correctly (the $username) and right under the _POST I've tested it to echo, and it works. So it makes me wonder if one piece of the following code is blanking it out. As in, setting it to " ".
Code: Select all
$username = $_POST["username"];
$verifycode = $_POST["verify"];
if (($username = "") || ($verifycode = ""))
{
die("Gotta fill out all the fields, silly!");
}
$verifycheck = mysql_query("SELECT confkey FROM user WHERE name = '$username'");
$verified = mysql_query("SELECT verified FROM user WHERE name = '$username'");
if ($verified == 'yes')
die("Hmm, $username, it seems as if you're already validated. Try logging in. ");
if ($verifycheck == $verifycode)
{
echo "User $username verified correctly, welcome to Monbre!";
mysql_query("UPDATE user SET verified = 'yes' WHERE name = '$username'");
}
else
die("Sorry, $username, it seems you have entered the wrong validation code... perhaps you miss-typed it?");
;