You can valid each field of your form and show errors according them. For Example
PHP COde
<?php
$userError="";
if(isset($_POST['input1']) && !empty($_POST['input1'])){
//First assign some variables to posted variables like
$fullname = $_POST["input1"];
$email = = $_POST["input2"];
$password = = $_POST["input3"];
//CHECK FULLNAME IS EMPTY
if($fullname == "") {
echo "Please Enter your Name First";
}else if($email == "") { //IF EMAIL IS EMPTY
$userError = "Please Enter Your Email";
exit();
}else if($password == "") { //IF PASSWORD IS EMPTY
$userError = "Enter your password";
exit();
}else { //IF ALL FORM IS FILLED
//SOME OTHER CODE
}
}
?>
Create a php error variable to show errors like this
HTML FORM
<form name="formLogin" method="post" action="makeit.php">
<!-- show errors -->
<?php echo $userError;?>
<div class="tclpad" style="width:90px;"><span class="std">Fullname:</span></div>
<div class="tclpad"><input name="input1" class="std" size="65" type="text" required></div>
<div class="clear"> </div>
<div class="tclpad" style="width:90px;"><span class="std">email:</span></div>
<div class="tclpad"><input name="input2" class="std" size="65" value="" type="password" required></div>
<div class="clear"> </div>
<div class="tclpad" style="width:90px;"><span class="std">Six-digit pin:</span></div>
<div class="tclpad"><input name="input3" class="std" size="10" value="" type="password" required></div>
<div class="clear"> </div>
That’s all.
3
solved I want to make a notification error if one of field is empty