Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_SERVER ['REQUEST_METHOD'] == 'POST') {
- $errors = array();
- if (empty($_POST ['nom'])) {
- $errors ['error_nom'] = "Merci de remplir ce champ";
- }
- if (empty ($_POST ['mail'])) {
- $errors ['error_mail'] = " Merci de remplir ce champ ";
- }
- if (empty($_POST ['telephone'])) {
- $errors ['error_telephone'] = " Merci de remplir ce champ ";
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset=" UTF-8 ">
- <title> Formulaire </title>
- <style type="text/css">
- .$ error {
- couleur: rouge;
- }
- </style>
- </head>
- <body>
- <?php
- if ($_SERVER ['REQUEST_METHOD'] == 'POST' && count($errors) == 0) {
- include('sucess.php');
- } else {
- include('form.php');
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement