Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $error = '';
- $nom = ''; // C'est Fait
- $prenom = ''; // C'est Fait
- $entreprise = ''; // C'est Fait
- $telephone = ''; // C'est Fait
- $message = ''; // EN COURS
- $accept = ''; // ???
- $submit = ''; // PAS FAIT
- function clean_text ($string){
- $string = trim($string);
- $string = stripslashes($string);
- $string = htmlspecialchars($string);
- return $string;
- }
- if (isset($_POST["submit"])) {
- if (empty($_POST["nom"])) {
- $error .= '<p><label class = "text-probleme">Entrez votre nom s il vous plait</label></p>';
- } else {
- $nom = clean_text($_POST["nom"]);
- if (!preg_match("/^[a-zA-Z ]*$/", $nom)) {
- $error .= '<p><label class = "text-probleme">Seulement les lettres et les espaces sont autorisé</label></p>';
- }
- }
- if (empty($_POST["prenom"])) {
- $error .= '<p><label class = "text-probleme">Entrez votre prenom s il vous plait</label></p>';
- } else {
- $prenom = clean_text($_POST["prenom"]);
- if (!preg_match("/^[a-zA-Z ]*$/", $prenom)) {
- $error .= '<p><label class = "text-probleme">Seulement les lettres et les espaces sont autorisé</label></p>';
- }
- }
- if (empty($_POST["email"])) {
- $error .= '<p><label class = "text-probleme">Entrez votre adresse email s il vous plait</label></p>';
- } else {
- $email = clean_text($_POST["email"]);
- if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
- $error .= '<p><label class = "text-probleme>Le format de votre adresse email est inconnu</label>"</p>';
- }
- }
- if (empty($_POST["entreprise"])) {
- $error .= '<p><label class = "text-probleme">Entrez le nom de votre entreprise</label></p>';
- } else {
- if (!preg_match("/^[a-zA-Z ]*$/", $prenom)) {
- $error .= '<p><label class = "text-probleme">Le format de lettre de votre entreprise est inconnu (des lettres de A à Z avec des espaces sont uniquement autorisé</label></p>';
- }
- if (empty($_POST["telephone"])) {
- $error .= '<p><label class = "text-probleme">Entrez votre numéro de téléphone s il vous plait</label></p>';
- } else {
- if (!preg_match("/^[0-9 ]*$/", $telephone)) {
- $error .= '<p><label class = "text-probleme">Le format de votre numéro de téléphone est inconnu, entrez des chiffres entre 0 et 9</label></p>';
- }
- }
- if (empty($_POST["message"])) {
- $error .= '<p><label class = "text-probleme">Veuillez entrez un message pour vous présentez en quelque mot</label></p>';
- } else {
- $message = clean_text($_POST["message"]);
- }
- if ($error == '') {
- $file_open = fopen("contact_data.csv", "a");
- $no_rows = count(file("contact_data.csv"));
- if ($no_rows > 1) {
- $no_rows = ($no_rows - 1) + 1;
- }
- $form_data = array(
- 'sr_no' => $no_rows,
- 'nom' => $nom,
- 'prenom' => $prenom,
- 'entreprise' => $entreprise,
- 'telephone' => $telephone,
- 'message' => $message
- );
- fputcsv($file_open, $form_data);
- $error .= '<p><label class = "text-probleme">Merci de vous être inscrit au Five, vous êtes maintenant connecter a la nouvelle innovation.</label></p>';
- $nom = '';
- $prenom = '';
- $entreprise = '';
- $telephone = '';
- $message = '';
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Le Bidule - Accueil</title>
- <meta charset="utf-8">
- <link rel="stylesheet" type="text/css" href="css/styles.css">
- <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
- <script src = "https://maxcdn.bootstarpcdn.com/bootstarp/3.3.7/js/bootstrap.min.js"></script>
- </head>
- <body>
- <section id = "main">
- <a href = "https://www.facebook.com/LeFive-202874746825195/" target = "_blank"><img class = "logo" src="Images/logo_LE FIVE 1.png"alt="logo du five, avec un liens vers la page facebook"/></a>
- <!--<nav class = "button">
- <ul>
- <a href="index.html" class = "boutton">Acceuil<li></li></a>
- <a href="social.html" class = "boutton">Réseaux Sociaux<li></li></a>
- <a href="photos.html" class = "boutton">Photos<li></li></a>
- <a href="contact.html" class = "boutton"><li>Contact</li></a>
- </ul>
- </nav>-->
- </section>
- <section class = "animation-css">
- <video class = "video" controls>
- <source src="Vidéo/vine.mp4" autoplay>
- </video>
- <br><br><br><br><br>
- </section>
- <h1 class = "insc">Connecter vous a l'innovation !</h1>
- <p class = "inscri">Inscrivez-vous au fab-lab de Vitré.</p>
- <section class = "formulaire"> <!--Mettre les informations du formulaire dans la base de données-->
- <form id = "form" method = "post" action = "mail.php">
- <?php echo $error; ?>
- <input id = "form" type="text" placeholder = "Nom" name = "nom" required value="<?php echo $nom; ?>"><br>
- <input id = "form" type="text" placeholder = "Prénom" name = "prenom" required value="<?php echo $prenom; ?>" ><br>
- <input id = "form" type="text" placeholder = "Entreprise" name = "entreprise" required value= "<?php echo $entreprise; ?>"><br>
- <input id = "form" type = "text" placeholder = "Entrez votre adresse email" name = "email" required value="<?php echo $email; ?>"><br>
- <input id = "form" type="number" placeholder = "Numéro de téléphone" name = "telephone" required value="<?php echo $telephone; ?>"><br>
- <input id = "form" type="text" placeholder = "Ecrivez un message pour vous présentez en quelque ligne....." name="message" required value="<?php echo $message; ?>"><br>
- ACCEPTEZ LES NEWS ? <input id = "form" type="checkbox" name="eccept" required><br><br>
- <input type="submit" name="Envoyer"><input type="reset" name="effacer">
- </form>
- <br><br><br><br>
- </section>
- <section class = "copyright">
- <br>
- <p id = "copyright-fr">© Fab-Lab Le Five - All rights reserved © 2017-2019</p>
- <p id = "copyright-en">© Fab-Lav Le Five - Tous les droits sont réservés © 2017-2019</p>
- <p id = "copyright-es">© Fab-Lab Le Five - Todos los derechos están reservados © 2017-2019</p>
- </section>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement