-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
43 lines (38 loc) · 1.36 KB
/
contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact</title>
<link rel="stylesheet" href="css/styleContact.css">
</head>
<body>
<h1>Contact</h1>
<form method="post">
<label>Nom :</label>
<input type="text" name="nom" required placeholder="exemple : Denis Dupont">
<label>Email :</label>
<input type="email" name="email" required placeholder="exemple : [email protected]">
<label>Objet :</label>
<input type="text" name="objet" required placeholder="exemple : Informations sur...">
<label>Message :</label>
<textarea name="message" required placeholder="Votre message : "></textarea>
<button type="submit"> Envoyer </button>
</form>
<?php
if(isset($_POST['message'])){
$entete = 'MIME-Version: 1.0' . "\r\n";
$entete .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$entete .= 'From: ' . $_POST['email'] . "\r\n";
$message = '
<p><b>Nom : </b>' . $_POST['nom'] . '<br>
<b>Email : </b>' . $_POST['email'] . '<br><br>
<b>Message : </b><br>' . $_POST['message'] . '</p>';
$objet = $_POST['objet'];
$retour = mail('[email protected]', $objet, $message, $entete);
if($retour) {
echo '<p>Votre message a bien été envoyé.</p>';
}
}
?>
</body>
</html>