Probleme formulaire

SpiritAnghell Messages postés 19 Date d'inscription samedi 31 mai 2003 Statut Membre Dernière intervention 7 mai 2008 - 20 avril 2004 à 14:04
SpiritAnghell Messages postés 19 Date d'inscription samedi 31 mai 2003 Statut Membre Dernière intervention 7 mai 2008 - 20 avril 2004 à 18:42
Voila j'ai écrit un formulaire en php avec envoi de mail. Seulemen il considère que les variables sont vides. pourquoi cela? Voila le code:

<form method= "POST" action="nadform.php">
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1" height="29">
Nom: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-top-style:solid; border-top-width:1; border-bottom-style:solid; border-bottom-width:1"

height="29">
<small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="29">
Prénom: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="29"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="31">
Société: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="31"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="33">
Adresse: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="33"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="34">
Code
Postal:</td>
<td width="84%" style="border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="34"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="35">
Ville: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="35"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="35">
Pays: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="35"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: solid; border-bottom-width: 1" height="35">
Téléphone: </td>
<td width ="84%" style= "border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:solid; border-bottom-width:1" height="35"><small>
</small></td>
</tr>
<tr>
<td width="16%" style="border-left: 1px solid #111111; border-right-style: none; border-right-width:

medium; border-bottom-style: none; border-bottom-width: medium" height="34">
E-Mail: </td>
<td width ="84%" style="border-left-style:none; border-left-width:medium; border-right-style:solid;

border-right-width:1; border-bottom-style:none; border-bottom-width:medium" height="34"><small>
</small></td>
</tr>
<tr>
<td width="100%" style="border-right:1px solid #111111; border-bottom:1px solid #111111; border-left:1px

solid #111111; border-top-style: solid; border-top-width: 1; " height="27" colspan="2">

[devis.htm

]


 

; &nbs

p; &nb

sp; &n

bsp; &

nbsp;


</td>
</form>

ET LE CODE DU NADFORM.PHP :

<html>
<head></head>

<?
$MailTo = "spiritanghell@msn.com";
$MailSubject = "Devis MS-Partie 1";
$MailHeader = "From: $mail";

$Envoi = 1;
if ($nom == ""){
echo("Vous n'avez pas renseigné votre nom.
");
$Envoi = 0;
}
else {
$MailBody = "Nom : $nom\n";
}
if ($prenom == ""){
echo("Vous n'avez pas renseigné votre prénom.
");
$Envoi = 0;
}
else {
$MailBody .= "Prénom : $prenom\n";
}
if ($societe == ""){
echo("Vous n'avez pas renseigné votre société.
");
$Envoi = 0;
}
else {
$MailBody .= "Société : $societe\n";
}
if ($adresse == ""){
echo("Vous n'avez pas renseigné votre adresse.
");
$Envoi = 0;
}
else {
$MailBody .= "Adresse : $adresse\n";
}
if ($code == "0"){
echo("Vous n'avez pas renseigné votre code postal.
");
$Envoi = 0;
}
else {
$MailBody .= "Code Postal : $code\n";
}
if ($ville == ""){
echo("Vous n'avez pas renseigné votre ville.
");
$Envoi = 0;
}
else {
$MailBody .= "Ville : $ville\n";
}
if ($pays == ""){
echo("Vous n'avez pas renseigné votre pays.
");
$Envoi = 0;
}
else {
$MailBody .= "Pays : $pays\n";
}
if ($telephone == ""){
echo("Vous n'avez pas renseigné votre numéro de téléphone.
");
$Envoi = 0;
}
else {
$MailBody .= "Numéro de téléphone : $telephone\n";
}
if ($mail == ""){
echo("Vous n'avez pas renseigné votre e-mail.
");
$Envoi = 0;
}
else {
$MailBody .= "E-mail : $mail\n";
}

if ($Envoi == 1) {
mail($MailTo, $MailSubject, $MailBody, $MailHeader);
echo("Votre message a bien été envoyé");
}
?>

</html>

Voila voila... qd je submit sur le site ca me donne:
Vous n'avez pas renseigné votre nom.
Vous n'avez pas renseigné votre prénom.
Vous n'avez pas renseigné votre société.
Vous n'avez pas renseigné votre adresse.
Vous n'avez pas renseigné votre ville.
Vous n'avez pas renseigné votre pays.
Vous n'avez pas renseigné votre numéro de téléphone.
Vous n'avez pas renseigné votre e-mail.

AIDEZ MOI S'IL VOUS PLAIT! :'( et si vous voulez m'aider sur msn ce qui serait plus simple --> spiritanghell@msn.com

Merci d'avance.

5 réponses

morgandetoi06 Messages postés 389 Date d'inscription mercredi 23 avril 2003 Statut Membre Dernière intervention 17 décembre 2004 1
20 avril 2004 à 14:46
rajoute
$nom=$_POST['$nom'];
$prenom=$_POST['$prenom'];
etc...
( au debut du nadform.php )
www.morgan06.fr.fm
0
SiNeDeNiS Messages postés 11 Date d'inscription mardi 4 novembre 2003 Statut Membre Dernière intervention 20 avril 2004
20 avril 2004 à 15:26
oui morgandetoi06 a raison .. ou sinon bien tu doit activé les variable globale sur ton serveur .. sinon tout marche très bien mec .. @++
0
SpiritAnghell Messages postés 19 Date d'inscription samedi 31 mai 2003 Statut Membre Dernière intervention 7 mai 2008
20 avril 2004 à 15:49
hum j'ai fait ce que vous avez dit ca me donne le fichier suivant (avec quelques modif en +):

NADFORM.PHP

<?

$nom=$_POST['$nom'];
$prenom=$_POST['$prenom'];
$societe=$_POST['$societe'];
$adresse=$_POST['$adresse'];
$code=$_POST['$code'];
$ville=$_POST['$ville'];
$pays=$_POST['$pays'];
$telephone=$_POST['$telephone'];
$mail=$_POST['$mail'];
$MailTo = "spiritanghell@msn.com";
$MailSubject = "Devis MS-Partie 1";
$MailHeader = "From: $mail";

echo "Nom: $nom";
if (empty($nom)){
echo"Vous n'avez pas renseigné votre nom.
";
}
elseif (empty($prenom)){
echo("Vous n'avez pas renseigné votre prénom.
");
}
elseif (empty($societe)){
echo("Vous n'avez pas renseigné votre société.
");
}
elseif (empty($adresse)){
echo("Vous n'avez pas renseigné votre adresse.
");
}
elseif (empty($code)||$code == "0"){
echo("Vous n'avez pas renseigné votre code postal.
");
}
elseif (empty($ville)){
echo("Vous n'avez pas renseigné votre ville.
");

}
elseif (empty($pays)){
echo("Vous n'avez pas renseigné votre pays.
");

}
elseif (empty($telephone)){
echo("Vous n'avez pas renseigné votre numéro de téléphone.
");

}
elseif (empty($mail)){
echo("Vous n'avez pas renseigné votre e-mail.
");

}
else{
$MailBody = "Nom : $nom \nPrénom : $prenom\n Société : $societe\n Adresse : $adresse\n Code Postal : $code\n Ville : $ville\n

Pays : $pays\n Numéro de téléphone : $telephone\n E-mail : $mail\n";
mail($MailTo, $MailSubject, $MailBody, $MailHeader);
echo("Votre message a bien été envoyé");
}
?>

--> ca me donne
"Nom: Vous n'avez pas renseigné votre nom."
qd je clik sur envoyer... :'( HELP ME!
0
cs_Psy Messages postés 88 Date d'inscription mercredi 15 mai 2002 Statut Membre Dernière intervention 3 mai 2005
20 avril 2004 à 17:46
Utilise ca, il faut pas les second $ en fait !!

$nom=$_POST['nom'];
$prenom=$_POST['prenom'];
$societe=$_POST['societe'];
$adresse=$_POST['adresse'];
$code=$_POST['code'];
$ville=$_POST['ville'];
$pays=$_POST['pays'];
$telephone=$_POST['telephone'];
$mail=$_POST['mail'];

Voila
- Psy -
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
SpiritAnghell Messages postés 19 Date d'inscription samedi 31 mai 2003 Statut Membre Dernière intervention 7 mai 2008
20 avril 2004 à 18:42
merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci merci

:D :D :D
0
Rejoignez-nous