Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. if(isset($_POST['submit'])){
  2.  
  3.  
  4.  
  5. if(empty($name)) {
  6. $errors ++ ;
  7. echo "<p>You did not enter a name.</p>";
  8. } else {
  9. $errors = 0;
  10. }
  11.  
  12. if(empty($email)) {
  13. $errors ++ ;
  14. echo "<p>You did not enter an e-mail.</p>";
  15. } else {
  16. $cleanEmail = filter_var($email, FILTER_SANITIZE_EMAIL);
  17. if (!filter_var($cleanEmail, FILTER_VALIDATE_EMAIL)){
  18. $errors ++;
  19. echo "<p>Invalid e-mail. Please try again.</p>";
  20. } else {
  21. $errors = 0;
  22. }
  23.  
  24. }
  25.  
  26. } //closes isset
  27.  
  28. ?>
  29.  
  30.  
  31.  
  32.  
  33.  
  34. <div class="contact-form">
  35.  
  36.  
  37.  
  38. <div class="inputArea">
  39. <form action="<?php echo ($errors > 0) ? 'contact.php' : 'contactconfirm.php' ?>" method="post">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement