PHP: Créer un formulaire de ‘FeedBack’

Author:

 formulaire, commentaire
Download

<html>
 
 <head>
 
 </head>
 
 <body>
<form action="feedback.php" method="post">
 Nom d''utilisateur:
<input type="text" name="username" size="30">
 
 Email:
<input type="text" name="email" size="30">
 
 <textarea name="commentaires" cols="30" rows="5">
 </textarea>
<input type="submit" value="Envoyer le Commentaire">
 </form>
 
 </body>
 
</html>
 
-----------------------Script-----------------------
 
<?php
 
// Fichier: feedback.php
 
$username = $_POST['username'];
$email = $_POST['email'];
$commentaires = $_POST['commentaires'];
 
$to = "php@h.com";
$re = "Feedback";
$msg = $commentaires;
 
$headers  = "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=iso-8859-1
";
$headers .= "From: $email
";
 
mail( $to, $re, $msg, $headers );
 
?>
 
<html>
 
 <head>
 
 </head>
 
 <body>
<h3>Merci pour votre commentaire</h3>
 
 Message reçu de la part de  <?php echo($username); ?>
 Un email à été envoyé à cette adresse: <?php echo($email); ?>
 </body>
 
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


6 × two =