I am a beginner in php. And I want to know field level validation using php not by javascript or jquery. How to do this?
My incorrect code:
form method="POST" action="registrationp.php">
<input type="text" name="emailid"><?php session_start(); if(isset($_SESSION['error'])) {echo $_SESSION['error']; } ?></br>
<input type="submit" name="submit_form" value="Register"></form>
session_start();
if (empty($_POST['emailid'])) {
$emailid ="Please enter your emailid";
$_SESSION['error']=$emailid;
}
I tried but it is not working.please guide me.