i successfully sign-up,but i like to check the null entry in the form before other check.please healp.
This Is My Sign-up From
<form action="signup.php" method="post">
<label><b>User Name:</b></label><input type="text" name="login" /><br />
<label><b>Password :</b></label><input type="text" name="password" /><br />
<label><b>Confirm :<br/></label><input type="text" name="confirm" /><br />
<label><b>Email :</b></label><input type="text" name="email" /><br />
<label></label><b><input type="submit" value="Sign up" /></b>
</form>
And This Is My signup.php
<?php
$con=mysql_connect("host", "user", "pass") or die("cannot connect");
/* select the database */
mysql_select_db("db") or die("cannot select DB");
/* store the values submitted by form in variable */
$login = $_POST['login'];
$password = $_POST['password'];
$confirm = $_POST['confirm';
$email = $_POST['email'];
/* check if username is already in use or not */
$queryuser=mysql_query("SELECT * FROM tbl WHERE login='$login' ");
$checkuser=mysql_num_rows($queryuser);
if($checkuser != 0)
{
echo "<h1>Sorry,The Username *".$login."* Is Already Been Taken.</h1>";
echo "<h2>Please Try For A Different Username</h2>";}
else
{
/* check if password and confirm password matched */
if($password!= $confirm)
{ echo "<h1>Your Password and Confirm Password Were Not Matched</h1>"; }
else
{
/* write a query to insert user details into database */
$sql=mysql_query("INSERT INTO users (login, password,confirm,email)
VALUES
('$login', '$password','$confirm' , '$email')");
if($sql)
{ echo "<h1>Wellcome To Signup Page</h1>";
echo"<h2>Your Registration Succesfull</h2>"; }
else
{ echo "<h1>Error In Registration</h1>".mysql_error(); }
/* closing the if else statements */
}}
mysql_close($con)
?>