Ok, I've designed my signup page, how should I check that the username they entered has not been taken, what I do now:
You click the signup button it goes to signup.php, signup.php checks if the username isn't taken by doing this:
and at the end of the code I want to do this:
It seems like it would be a bit annoying doing it this way, rather than just displaying whether it's taken or not straight away, but I don't know how to do it.
Any idea's?
Kind Regards
You click the signup button it goes to signup.php, signup.php checks if the username isn't taken by doing this:
Code:
while ($row = mysql_fetch_array($result))
{
//real code
if ($username == $row["username"])
{
bUsernameTaken=true;
break;
}
//end
$id = $row["id"]; $user = $row["username"]; $pass = $row["password"]; $email = $row["email"];
echo ("<tr><td>".$id."</td><td>".$user."</td><td>".$pass."</td><td>".$email."</td>");
$iCount+=1;
}
and at the end of the code I want to do this:
Code:
if (bUsernameTaken)
{
//redirect back to signuser.html and display message saying username taken (not signuser.php)
//Not sure how to do that?
}
It seems like it would be a bit annoying doing it this way, rather than just displaying whether it's taken or not straight away, but I don't know how to do it.
Any idea's?
Kind Regards