I have registration form, with "username" and "password".
<form method="post" onSubmit="return check();" name="Reg">
<input type="text" name="email" id="email" class="sign-up-input" maxlength="30" placeholder="Username" >
<input type="password" class="sign-up-input" name="Password" id="Password" maxlength="25" placeholder="Password" >
<input type="submit" value="Sign up" name="signup" class="sign-up-button" onClick="time_get()">
</form>
After I enter values for "password" and "username", I want to check wheter those values are valid. First I want to check if the user entered values for "email" and "password", after the user press the "signup" button.
if(isset($_POST['signup']))
{
$error_text="";
$check_val=1;
if(isset($_POST['email']) && isset($_POST['password']))
{
//area 1
//entered values for email and password
$email_signup=$_POST['email'];
$password_signup=$_POST['password'];
//more code....
}
else
{
//area 2
//email or password are empty
$check_val=0;
$error_id=1;
}
}
For after I enter valid values for "email" and "password", and then press the "sign-up" button, it enter to "area 2", meaning that at least one value(email/password) is empty.
What is the problem with my code?