Envoi dun formulaire via php

Fermé
GEN - 5 oct. 2009 à 06:10
thecrazyspy Messages postés 413 Date d'inscription lundi 21 janvier 2008 Statut Membre Dernière intervention 13 novembre 2015 - 5 oct. 2009 à 11:18
Bonjour,

je veux que mon formulaire me soit enoyé sans que le client ait a passer par outlook, on m'a conseillé d'utiliser le php, c'est la premiere fois que je l'utilise et évidemment ça ne fonctionne pas.. quelqu'un peut m'aider..

voici le formulaire en question :

<html>
<title> Book Online</title>
<head>

<body>
<FONT COLOR="#09380f">
<FONT FACE="century gothic">
<h1 align=center><img src=BOOK.jpg> </h1>


<h2 align=center>
Reservations <br> </h2>

<h4 align=center>Please fill this form and press submit to receive informations on rooms availability</h4>
<TABLE BORDER=0; align=center>
<form method="POST" enctype="text/plain" action="emailform.php">
<div align="center"></div>
<p align="center">
<table width="566" border="0" align="center">
<p align="center">
</p><tr>
<td><font face="century gothic" size="2">Full name </font></td>
<td><input name="NAME" type="text"></td>
</tr><tr>

<td><font face="century gothic" size="2">Adress</font></td>
<td><input name="ADRESS" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">City</font></td>
<td><input name="CITY" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">State / province</font></td>

<td><input name="STATE_PROVINCE" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">Zip postal code</font></td>
<td><input name="POSTAL" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">Country</font></td>
<td><input name="COUNTRY" type="text"></td>
</tr><tr>

<td><font face="century gothic" size="2">Phone</font></td>
<td><input name="PHONE" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">Arrival date</font></td>
<td><input name="ARRIVAL" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">Departure date</font></td>

<td><input name="DEPARTURE" type="text"></td>
</tr><tr>
<td><font face="century gothic" size="2">Number of guests</font></td>
<td><input name="GUESTS" type="text"></td>
</tr><tr>
<td width><font face="century gothic" size="2">Contact E-mail</font></td>
<td width><input name="EMAIL" type="text"></td>
</tr><tr>

<td valign="top"><font face="century gothic" size="2">Comments / questions</font></td>
<td><textarea name="COMMENTS" cols="50" rows="10"></textarea></td>
</tr><tr>
</td>
<td>
<input type="reset" name="Reset" value="Erase"align="center">

<input align="center" type="submit" value="Submit">
</div></td>
</tr>
</table>
<div align="center"></div>
</form>

<h3 align=center><A HREF="index.html"><FONT COLOR="#09380f">Return to main page</FONT></a></h3>


</body>

</html>

et voici mon emailform.php

<html>
?php
$msg .= "NAME:\t$sender_NAME\n";
$msg .= "ADRESS:\t$sender_ADRESS\n";
$msg .= "CITY:\t$sender_CITY\n";
$msg .= "STATE_PROVINCE:\t$sender_PROVINCE\n";
$msg .= "POSTAL CODE:\t$sender_POSTAL\n";
$msg .= "COUNTRY:\t$sender_COUNTRY\n";
$msg .= "PHONE:\t$sender_PHONE\n";
$msg .= "ARRIVAL DATE:\t$ARRIVAL\n";
$msg .= "DEPARTURE DATE:\t$sender_DEPARTURE\n";
$msg .= "NUMBER OF GUESTS:\t$sender_GUESTS\n";
$msg .= "EMAIL:\t$sender_EMAIL\n\n";
$msg .= "COMMENTS:\t$sender_COMMENTS\n\n";

$recipient = "petite_geny@hotmail.com";
$subject = "RESERVATION ONLINE";

$mailheaders = "From: MANDALA APPART'HOTEL WEBSITE <> \n";
$mailheaders .= "Reply-To: $sender_mail\n\n";

mail($recipient, $subject, $msg, $mailheaders);

echo "<HTML><HEAD>";
echo "<TITLE>Tanks for your reservation</TITLE></HEAD><BODY>";
echo "<H1 align=center>Tanks, $sender_nom $sender_prenom</H1>";
echo "<P align=center>";
echo "WE'LL COMMUNICATE WITH YOU AS SOON AS POSSIBLE ! </P>";
echo "</BODY></HTML>";



?>

merci d'avance

Configuration: Windows XP
Firefox 3.5.3

1 réponse

thecrazyspy Messages postés 413 Date d'inscription lundi 21 janvier 2008 Statut Membre Dernière intervention 13 novembre 2015 43
5 oct. 2009 à 11:18
Bonjour,

dans un 1er temps, est ce que la fonction mail() de ton serveur est autorisée?
0

Discussions similaires