Fonction Mail php

Fermé
gen - 24 oct. 2009 à 17:26
avion-f16 Messages postés 19249 Date d'inscription dimanche 17 février 2008 Statut Contributeur Dernière intervention 15 juin 2024 - 24 oct. 2009 à 17:54
Bonjour,
cest mon premier code php, il doit envoyer linformation dun formulaire html a un courriel....
Voici le message d'erreur : Parse error: syntax error, unexpected T_STRING in C:\Program Files\EasyPHP5.2.10\www\mail.php on line 8

et le code :
<?php
if ($_POST['submit-form'] == 'ok')
{

$to = 'info@monsite.fr';

$subject = 'Reservation Online;
$message = "Bonjour, il y a eu une reservation online"."\n\nNAME : ".$_POST['NAME']."\n\nADRESS: ".$_POST['ADRESS']."\n\nCITY: ".$_POST

['CITY']."\n\nSTATE/PROVINCE : ".$_POST['STATE_PROVINCE']."\n\nPOSTAL : ".$_POST['POSTAL']."\n\nCOUNTRY: ".$_POST['COUNTRY']."\n\nPHONE : ".$_POST

['PHONE']."\n\nARRIVAL : ".$_POST['ARRIVAL']."\n\nDEPARTURE: ".$_POST['DEPARTURE']."\n\nGUESTS : ".$_POST['GUESTS']."\n\nEMAIL : ".$_POST

['EMAIL']."\n\nCOMMENTS : ".$_POST['COMMENTS']."\n\n\n
$headers = 'From: xxxxxxxx@xxxxxxx.com' . "\r\n" .
'Reply-To: xxxxxx@xxxxxxxx.com ' . "\r\n" .
'X-Mailer: PHP/' . phpversion();


mail($to, $subject, $message, $headers);


}
else { ?>

<? php } >

quelqu'un peu maider ??? je suis debutante et jai du mal a comprendre
A voir également:

2 réponses

avion-f16 Messages postés 19249 Date d'inscription dimanche 17 février 2008 Statut Contributeur Dernière intervention 15 juin 2024 4 504
24 oct. 2009 à 17:28
...
$to = 'info@monsite.fr';

$subject = 'Reservation Online;
$message = "Bonjour, il y a eu une reservation online"."\n\nNAME : ".$_POST['NAME']."\n
...
0
maintenant jai

Parse error: syntax error, unexpected $end in C:\Program Files\EasyPHP5.2.10\www\mail.php on line 27


<?php
if ($_POST['submit-form'] == 'ok')
{

$to = 'info@mandalahotel.fr';

$subject = 'Reservation Online';

$message = "Reservation Online"."\n\nNAME : ".$_POST['NAME']."\n\nADRESS: ".$_POST['ADRESS']."\n\nCITY: ".$_POST

['CITY']."\n\nSTATE/PROVINCE : ".$_POST['STATE_PROVINCE']."\n\nPOSTAL : ".$_POST['POSTAL']."\n\nCOUNTRY: ".$_POST['COUNTRY']."\n\nPHONE : ".$_POST

['PHONE']."\n\nARRIVAL : ".$_POST['ARRIVAL']."\n\nDEPARTURE: ".$_POST['DEPARTURE']."\n\nGUESTS : ".$_POST['GUESTS']."\n\nEMAIL : ".$_POST

['EMAIL']."\n\nCOMMENTS : ".$_POST['COMMENTS']."\n\n\n

'X-Mailer: PHP/' . phpversion();


mail($to, $subject, $message);


}
else { ?>

<?php } >
0
avion-f16 Messages postés 19249 Date d'inscription dimanche 17 février 2008 Statut Contributeur Dernière intervention 15 juin 2024 4 504
24 oct. 2009 à 17:54
['PHONE']."\n\nARRIVAL : ".$_POST['ARRIVAL']."\n\nDEPARTURE: ".$_POST['DEPARTURE']."\n\nGUESTS : ".$_POST['GUESTS']."\n\nEMAIL : ".$_POST

['EMAIL']."\n\nCOMMENTS : ".$_POST['COMMENTS']."\n\n\n

'X-Mailer: PHP/' . phpversion(); 

Maintenant, cherches et codes proprement.
0