Could anyone explain me how to check and register username and password in the same page?
How can I echo the "wrong username and password" message in the form?
Thanks in advance.
Check Login
$result=mysql_query($sql);
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
FORM
<form class="clearfix" name="form1" method="POST" action="">