Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LA1720/86a973a026fce2bcc37b54640c7526a3 to your computer and use it in GitHub Desktop.
Save LA1720/86a973a026fce2bcc37b54640c7526a3 to your computer and use it in GitHub Desktop.
1.1. Les formulaires en PHP - Récupération BY L.A
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="thanks.php" method="post">
<div>
<label for="fname">First name :</label>
<input type="text" id="fname" name="firstname">
</div>
<div>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lastname">
</div>
<div>
<label for="email">Email :</label>
<input type="email" id="email" name="email">
</div>
<div>
<label for="phone">Phone :</label>
<input type="phone" id="phone" name="phone">
</div>
<div>
<label for="subject"></label>
<select name="subject" id="subject">
<option value="1">For this reason</option>
<option value="2">Another reason</option>
</select>
</div>
<div>
<label for="message">Message :</label>
<textarea id="message" name="message"></textarea>
</div>
<div class="button">
<button type="submit">SEND</button>
</div>
</form>
</body>
</html>
<?php
echo 'Merci '. $_POST['firstname'] .' '. $_POST['lastname'] .' de nous avoir contacté à propos de '. $_POST['subject'] . '<br>' .'
Un de nos conseiller vous contactera soit à l’adresse '.$_POST['email'] .' ou par téléphone au '.$_POST['phone'] .' dans les plus brefs délais pour traiter votre demande : <br>'.
$_POST['message'] ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment