Pb formulaire
mikil
Messages postés
187
Statut
Membre
-
mikil Messages postés 187 Statut Membre -
mikil Messages postés 187 Statut Membre -
Bonjour, j'ai un problem avec mon formulaire, il m'envoie plus de message et un code d'erreur s'affiche le voici:
Parse error: parse error, unexpected T_STRING in d:\www\33immobilier.com\htdocs\contact.php on line 24
Voici mon formulaire:
et voici le code php
merci d'avance
Parse error: parse error, unexpected T_STRING in d:\www\33immobilier.com\htdocs\contact.php on line 24
Voici mon formulaire:
<form method="post" action="contact.php"
name="formulaire2" onsubmit="return verif_champs()">
<table
style="text-align: left; margin-left: auto; margin-right: auto; width: 483px; height: 295px;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr align="left">
<td
style="width: 153px; text-align: right; background-color: rgb(43, 209, 154);"><span
style="color: rgb(204, 51, 204);">NOM:</span><span
style="color: rgb(255, 0, 0);">*</span></td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><input
name="NOM"></td>
</tr>
<tr align="left">
<td
style="width: 153px; text-align: right; background-color: rgb(44, 218, 160);"><span
style="color: rgb(204, 51, 204);">Prénom:</span><span
style="color: rgb(255, 0, 0);">*</span></td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><input
name="Prenom"></td>
</tr>
<tr align="left">
<td
style="width: 153px; text-align: right; background-color: rgb(44, 218, 160);"><span
style="color: rgb(255, 0, 0);"></span><span
style="color: rgb(204, 51, 204);">Code Postal:</span><span
style="color: rgb(255, 0, 0);"></span></td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><input
size="7" name="Code Postal"></td>
</tr>
<tr align="left">
<td
style="width: 153px; text-align: right; background-color: rgb(44, 218, 160);"><span
style="color: rgb(204, 51, 204);">Tel:</span><span
style="color: rgb(255, 0, 0);">*</span></td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><input
size="15" name="Tel"></td>
</tr>
<tr align="left">
<td
style="width: 153px; text-align: right; background-color: rgb(44, 218, 160);"><span
style="color: rgb(255, 0, 0);"></span><span
style="color: rgb(204, 51, 204);">Fax:</span></td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><input
size="15" name="Fax"></td>
</tr>
<tr align="left">
<td
style="width: 153px; text-align: right; background-color: rgb(44, 218, 160); color: rgb(204, 51, 204);">E-mail:</td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><input
name="e-mail"></td>
</tr>
<tr>
<td
style="width: 153px; text-align: right; background-color: rgb(44, 218, 160);"><span
style="color: rgb(204, 51, 204);">Votre message</span><span
style="color: rgb(255, 0, 0);">*</span></td>
<td
style="width: 430px; background-color: rgb(44, 218, 160);"><textarea
wrap="soft" cols="30" rows="5" name="Commentaires
et voici le code php
<?php
$sujet = date("d/m/Y H:i:s" )." Contact";
$contenu = "";
$contenu .= "Nom : ".$_POST['NOM']."\n";
$contenu .= "Prénom : ".$_POST['Prenom']."\n";
$contenu .= "Code Postal:".$_POST['Code Postal']."\n";
$contenu .= "Tel: ".$_POST['Tel']."\n";
$contenu .= "Fax: ".$_POST['Fax']."\n";
$contenu .= "e-mail: ".$_POST['e-mail']."\n";
$contenu .= "Commentaires: ".$_POST['Commentaires']."\n";
if(mail("comert@hotmail.fr", $sujet, $contenu))
{
print "<b>Mail envoyé
<br>
<a
style="text-decoration: underline; font-weight: bold; color: rgb(51, 51, 255);"
href="index.html">RETOUR à l'accueil</a>
</b>";
}
else
{
print "<b>Erreur</b>";
}
?>
merci d'avance
A voir également:
- Pb formulaire
- Whatsapp formulaire opposition - Guide
- Formulaire de réclamation facebook compte désactivé - Guide
- Formulaire de reclamation instagram - Guide
- Confirmer le nouvel envoi du formulaire err_cache_miss - Forum Google Chrome
- Récupérer compte hotmail sans formulaire - Forum Hotmail / Outlook.com
6 réponses
faut apprendre à lire ;-)
php parse error unexpected t string expecting or
php parse error unexpected t string expecting or
<?php
$sujet = date("d/m/Y H:i:s" )." Contact";
$contenu = "";
$contenu .= "Nom : ".$_POST['NOM']."\n";
$contenu .= "Prénom : ".$_POST['Prenom']."\n";
$contenu .= "Code Postal:".$_POST['Code Postal']."\n";
$contenu .= "Tel: ".$_POST['Tel']."\n";
$contenu .= "Fax: ".$_POST['Fax']."\n";
$contenu .= "e-mail: ".$_POST['e-mail']."\n";
$contenu .= "Commentaires: ".$_POST['Commentaires']."\n";
if(mail("comert@hotmail.fr", $sujet, $contenu))
{
print "<b>Mail envoyé
<br>
<a
style=\"text-decoration: underline; font-weight: bold; color: rgb(51, 51, 255);\"
href=\"index.html\">RETOUR à l'accueil</a>
</b>";
}
else
{
print "<b>Erreur</b>";
}
?>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
je l'ai corrigée ton erreur... il faut apprendre à lire ;-)
php parse error unexpected t string expecting or
Je cite : Cette erreur, fréquente, se produit notamment lorsqu'un guillemet est présent dans une chaîne délimitée par ce même type de guillemets.
Dans ce genre de situation l'interpréteur PHP ne sait pas où commence et où finit la chaîne. La solution consiste à "échapper" les guillemets posant problème, en les faisant précéder d'une barre oblique inverse (antislash)
Le parseur PHP indique généralement la ligne où l'erreur a eu lieu.
Parse error: parse error, unexpected T_STRING in d:\www\33immobilier.com\htdocs\contact.php on line 24
line 21: print "<b>Mail envoyé
line 22: <br>
line 23: <a
line 24: style=\"text-decoration: underline; font-weight: bold; color: rgb(51, 51, 255);\"
line 25: href=\"index.html\">RETOUR à l'accueil</a>
line 26: </b>";
php parse error unexpected t string expecting or
Je cite : Cette erreur, fréquente, se produit notamment lorsqu'un guillemet est présent dans une chaîne délimitée par ce même type de guillemets.
Dans ce genre de situation l'interpréteur PHP ne sait pas où commence et où finit la chaîne. La solution consiste à "échapper" les guillemets posant problème, en les faisant précéder d'une barre oblique inverse (antislash)
Le parseur PHP indique généralement la ligne où l'erreur a eu lieu.
Parse error: parse error, unexpected T_STRING in d:\www\33immobilier.com\htdocs\contact.php on line 24
line 21: print "<b>Mail envoyé
line 22: <br>
line 23: <a
line 24: style=\"text-decoration: underline; font-weight: bold; color: rgb(51, 51, 255);\"
line 25: href=\"index.html\">RETOUR à l'accueil</a>
line 26: </b>";