Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['submit'])){
- if(empty($name)) {
- $errors ++ ;
- echo "<p>You did not enter a name.</p>";
- } else {
- $errors = 0;
- }
- if(empty($email)) {
- $errors ++ ;
- echo "<p>You did not enter an e-mail.</p>";
- } else {
- $cleanEmail = filter_var($email, FILTER_SANITIZE_EMAIL);
- if (!filter_var($cleanEmail, FILTER_VALIDATE_EMAIL)){
- $errors ++;
- echo "<p>Invalid e-mail. Please try again.</p>";
- } else {
- $errors = 0;
- }
- }
- } //closes isset
- ?>
- <div class="contact-form">
- <div class="inputArea">
- <form action="<?php echo ($errors > 0) ? 'contact.php' : 'contactconfirm.php' ?>" method="post">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement