Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. if ($_SERVER ['REQUEST_METHOD'] == 'POST') {
  3. $errors = array();
  4. if (empty($_POST ['nom'])) {
  5. $errors ['error_nom'] = "Merci de remplir ce champ";
  6. }
  7. if (empty ($_POST ['mail'])) {
  8. $errors ['error_mail'] = " Merci de remplir ce champ ";
  9. }
  10. if (empty($_POST ['telephone'])) {
  11. $errors ['error_telephone'] = " Merci de remplir ce champ ";
  12. }
  13. }
  14. ?>
  15. <!DOCTYPE html>
  16. <html>
  17. <head>
  18. <meta charset=" UTF-8 ">
  19. <title> Formulaire </title>
  20. <style type="text/css">
  21. .$ error {
  22. couleur: rouge;
  23. }
  24. </style>
  25. </head>
  26. <body>
  27. <?php
  28. if ($_SERVER ['REQUEST_METHOD'] == 'POST' && count($errors) == 0) {
  29. include('sucess.php');
  30. } else {
  31. include('form.php');
  32. }
  33. ?>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement