Probleme de formulaire (formmail.php)
Résolu
mathieu_n
Messages postés
65
Date d'inscription
Statut
Membre
Dernière intervention
-
mathieu_n Messages postés 65 Date d'inscription Statut Membre Dernière intervention -
mathieu_n Messages postés 65 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je n'arrive pas à faire fonctionner mon formulaire sur mon site internet.
J'utilise donc le formulaire suivant a l'intérieur de la page "formulaire.html"
<form method="post" action="formmail.php">
<!-- <input name="subject" value="formmail" type="hidden" /> -->
Nom
: <input name="Nom" value="" type="text" /> <span style="color: rgb(255, 0, 0);">*</span><br />
Prénom : <input name="Prenom" value="" type="text" /> <br />
code postal: <input name="code" value="" type="text" /><br />
adresse mail: <input name="mail" value="" type="text" />
<span style="color: rgb(255, 0, 0);">*</span><br />
<br />
Dans le cas d'une commande, vous souhaitez :<br />
<input name="exp" type="radio" />que
la commande vous soit expédiée<br />
<input name="exp" type="radio" /> venir
récupérer votre commande à Ambazac (87)<br />
<br />
<p>Ecrivez vos questions ou votre commande :<br />
<textarea name="commande" rows="8" cols="55">texte
</textarea></p>
<p><input value="Envoyer" type="submit" /> </p>
</form>
Afin de pouvoir recevoir le contenu sur mon adresse mail, j'utilise le fichier (formmail.php)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<?php
$TO = "test@bouillette-maison.fr ";
$h = "From: " . $TO;
$message = "";
while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}
mail($TO, $subject, $message, $h);
Header("Location: http://www.bouillette-maison.fr");
?>
</body>
</html>
Une fois tout ceci en ligne, un message d'erreur apparait (erreur 405).
Merci de bien vouloir m'eclairer
Je n'arrive pas à faire fonctionner mon formulaire sur mon site internet.
J'utilise donc le formulaire suivant a l'intérieur de la page "formulaire.html"
<form method="post" action="formmail.php">
<!-- <input name="subject" value="formmail" type="hidden" /> -->
Nom
: <input name="Nom" value="" type="text" /> <span style="color: rgb(255, 0, 0);">*</span><br />
Prénom : <input name="Prenom" value="" type="text" /> <br />
code postal: <input name="code" value="" type="text" /><br />
adresse mail: <input name="mail" value="" type="text" />
<span style="color: rgb(255, 0, 0);">*</span><br />
<br />
Dans le cas d'une commande, vous souhaitez :<br />
<input name="exp" type="radio" />que
la commande vous soit expédiée<br />
<input name="exp" type="radio" /> venir
récupérer votre commande à Ambazac (87)<br />
<br />
<p>Ecrivez vos questions ou votre commande :<br />
<textarea name="commande" rows="8" cols="55">texte
</textarea></p>
<p><input value="Envoyer" type="submit" /> </p>
</form>
Afin de pouvoir recevoir le contenu sur mon adresse mail, j'utilise le fichier (formmail.php)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<?php
$TO = "test@bouillette-maison.fr ";
$h = "From: " . $TO;
$message = "";
while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}
mail($TO, $subject, $message, $h);
Header("Location: http://www.bouillette-maison.fr");
?>
</body>
</html>
Une fois tout ceci en ligne, un message d'erreur apparait (erreur 405).
Merci de bien vouloir m'eclairer
5 réponses
il manque des choses:
formmail.php
merci.html
<form method="post" action="formmail.php"> <!-- <input name="subject" value="formmail" type="hidden" /> --> Nom : <input name="Nom" value="" type="text" /> <span style="color: rgb(255, 0, 0);">*</span><br /> Prénom : <input name="Prenom" value="" type="text" /> <br /> code postal: <input name="code" value="" type="text" /><br /> adresse mail: <input name="mail" value="" type="text" /> <span style="color: rgb(255, 0, 0);">*</span><br /> <br /> Dans le cas d'une commande, vous souhaitez :<br /> <input name="exp" type="radio" value="Cde expédiée" />que la commande vous soit expédiée<br /> <input name="exp" type="radio" value="Cde recuperee Ambazac" /> venir récupérer votre commande à Ambazac (87)<br /> <br /> <p>Ecrivez vos questions ou votre commande :<br /> <textarea name="commande" rows="8" cols="55">texte </textarea></p> <p><input value="Envoyer" type="submit" name="envoyer "/> </p> </form>
formmail.php
<?php $TO = "test@bouillette-maison.fr "; $h = "From: " . $TO; $h .='Content-Type: text/plain; charset="iso-8859-1"'."\n"; $h .='Content-Transfer-Encoding: 8bit'; $message = ""; $subject= "Commande"; //il manque le sujet ! while (list($key, $val) = each($_POST)) { $message .= "$key : $val\n"; } //test si bien envoyé if(mail($TO, $subject, $message, $h)){ Header("Location: merci.html"); //renvoi vers la page merci }else{ echo "pb d'envoi du mail"; } ?>
merci.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> Merci votre commande nous a bien été envoyée. <br /><br /> <a href="http://www.bouillette-maison.fr">retour au site bouillette-maison.fr</a> </body> </html>
Merci beaucoup Alain_42 pour votre réponse rapide.
Malheureusement, je viens de faire les changements et j'ai toujours le même message d'erreur sur mon navigateur:
The page cannot be displayed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
Please try the following:
Contact the Web site administrator if you believe that this request should be allowed.
Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)
Technical Information (for support personnel)
Go to Microsoft Product Support Services and perform a title search for the words HTTP and 405.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Setting Application Mappings, Securing Your Site with Web Site Permissions, and About Custom Error Messages.
Malheureusement, je viens de faire les changements et j'ai toujours le même message d'erreur sur mon navigateur:
The page cannot be displayed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
Please try the following:
Contact the Web site administrator if you believe that this request should be allowed.
Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)
Technical Information (for support personnel)
Go to Microsoft Product Support Services and perform a title search for the words HTTP and 405.
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Setting Application Mappings, Securing Your Site with Web Site Permissions, and About Custom Error Messages.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question