Validating Email Address Form Input

Control Over User Login Procedure - Cookies Authentication
Control Over User Login Procedure - Cookies Authentication

Problem:- Validating Email Address Form Input

Solution:-

<?php 

if ($_SERVER['REQUEST_METHOD']=='GET') {?>

<form action="<?php echo htmlentities($_SERVER['SCRIPT_NAME']); ?>" method="POST" >
	<input type="text" name="email"><br>
	<input type="submit" value="Check Mail ID">
</form>

<?php
}else{
	if (filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)) {
		echo $_POST['email'];
		}else{
			echo $_POST['email'], ' isn\'t a valid email ID';
		}
}
	


 ?>

इसे भी पढ़े – Validating Number Form Input

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *