voici avec les balises
le formulaire est dans une page type
<?php if (class_exists('MailPress')) MailPress::form(); ?>
<form id="myForm" method="POST" action="http://www.stopinsectes.com/wp-content/themes/StopFinal/send.php" name="formulaire">
<ul id="form">
<li class="simpleinput"><label>Nom complet:</label><input type="text" name="name"></input></li>
<li class="simpleinput"><label>Téléphone:</label><input type="text" name="tel"></input></li>
<li class="simpleinput"><label>Adresse:</label><input type="text" name="adresse"></input></li>
<li class="simpleinput"><label>Ville:</label><input type="text" name="ville"></input></li>
<li class="simpleinput"><label>Code Postal:</label><input type="text" name="codepostal"></input></li>
<li class="simpleinput"><label>Email:</label><input type="text" name="mail"></input></li>
<li><label>Je souhaite:</label>
<input type="checkbox" name="doc"></input> recevoir une documentation<br />
<input type="checkbox" name="appel"></input> la visite d'un commercial, pour un diagnostic<br />et un devis gratuit<br />
</li>
<li><label>Vous souhaitez nous rencontrer pour:</label></li>
<li><label>Insectes</label>
<input type="checkbox" name="desinsectisation"></input> désinsectisation<br />
<input type="checkbox" name="desinfection"></input> désinfection<br />
<input type="checkbox" name="demoustication"></input> démoustication<br />
<input type="checkbox" name="jardin"></input> traitement des jardins<br />
<input type="checkbox" name="denrees"></input> fumigation des denrées stockées<br />
</li>
<li><label>Rongeurs</label>
<input type="checkbox" name="deratisation"></input> dératisation
</li>
<li><label>Pigeons</label>
<input type="checkbox" name="depigeonnage"></input> dépigeonnage<br />
<input type="checkbox" name="chauvesouris"></input> chauve-souris<br />
</li>
<li><label>Termites</label>
<input type="checkbox" name="preventif"></input> traitement préventif<br />
<input type="checkbox" name="curatif"></input> traitement curatif<br />
<input type="checkbox" name="charpentes"></input> traitement des charpentes<br />
<input type="checkbox" name="art"></input> fumigation mobilier et objets d'art<br />
</li>
<li><label>Franchise</label>
<input type="checkbox" name="franchise"></input> merci de m'adresser votre documentation<br />
</li>
<li><label for=message>Commentaires:</label><textarea class="format" name="message" rows="4"></textarea></li>
<li class="simpleinput"><label>Sécurité:<span style="font-size:11px;"> (combien font 2 + 2?)</span></label><input type="text" name="capcha"></input></li>
<li><input id="send" type="image" src="<?php bloginfo('template_url'); ?>/img/boutonenvoyer.gif" width="77" height="22" value="submit" border="0" /></li>
</ul>
</form>
</div>
<?php } ?>
le fichier send.php
<?php
// récupération des variables
$i=0;
foreach ($_POST as $key => $value){
if ($i == 0) {$allpost = '&'.$key.'='.$value;}
if ($i>0) {$allpost .= '&'.$key.'='.$value;}
$i++;
}
$name = $_POST['name'];
$tel = $_POST['tel'];
$adresse = $_POST['adresse'];
$ville = $_POST['ville'];
$mail = $_POST['mail'];
$codepostal = $_POST['codepostal'];
$capcha = $_POST['capcha'];
$doc = $_POST['doc'];
$appel = $_POST['appel'];
$desinsectisation = $_POST['desinsectisation'];
$desinfection = $_POST['desinfection'];
$demoustication = $_POST['demoustication'];
$jardin = $_POST['jardin'];
$denrees = $_POST['denrees'];
$deratisation1 = $_POST['deratisation'];
$depigeonnage = $_POST['depigeonnage'];
$chauvesouris = $_POST['chauvesouris'];
$preventif = $_POST['preventif'];
$curatif = $_POST['curatif'];
$charpentes = $_POST['charpentes'];
$art = $_POST['art'];
$franchise = $_POST['franchise'];
$message = $_POST['message'];
// On peuple
if (!empty($desinsectisation)) {$un = '<li>désinsectisation</li>'."\n";}
if (!empty($desinfection)) {$deux = '<li>désinfection</li>'."\n";}
if (!empty($demoustication)) {$trois = '<li>démoustication</li>'."\n";}
if (!empty($jardin)) {$quatre = '<li>traitement des jardins</li>'."\n";}
if (!empty($denrees)) {$onze = '<li>fumigation des denrées stockées</li>'."\n";}
if (!empty($deratisation)) {$cinq = '<li>deratisation</li>'."\n";}
if (!empty($depigeonnage)) {$six = '<li>depigeonnage</li>'."\n";}
if (!empty($chauvesouris)) {$sept = '<li>chauve-souris</li>'."\n";}
if (!empty($preventif)) {$huit = '<li>traitement préventif anti-termites</li>'."\n";}
if (!empty($curatif)) {$neuf = '<li>traitement curatif anti-termites</li>'."\n";}
if (!empty($charpentes)) {$douze = '<li>traitement des charpentes</li>'."\n";}
if (!empty($art)) {$treize = '<li>fumigation du mobilier et des objets d\'art</li>'."\n";}
if (!empty($franchise)) {$dix = '<li>demande d\'informations sur la franchise</li>'."\n";}
if (!empty($doc)) {$doc = 'oui';} else {$doc = 'non';}
if (!empty($appel)) {$appel = 'oui';} else {$appel = 'non';}
$html = '<h3>Données client :</h3><span style="text-transform:uppercase; font-size:large;">'.$name.'</span></strong><br />';
$html .= 'Téléphone: '.$tel.'<br />Adresse: '.$adresse.'<br />Ville: '.$ville.'<br/>Mail : <a href="mailto:'.$mail.'">'.$mail.'</a><br />Code Postal: '.$codepostal.'<br />';
$html .= 'Demande de documentation: '.$doc.'<br />';
$html .= 'Appeler le client pour un devis gratuit: '.$appel.'<br />';
$html .= '<h3>Rendez-vous souhaité:</h3><strong>Le client souhaite un rendez-vous pour:</strong><br />';
$html .= '<ul>'.$un.$deux.$trois.$quatre.$onze.$cinq.$six.$sept.$huit.$neuf.$douze.$treize.$dix.'</ul><br />';
$html .= '<h3>Commentaires : </h3>'.stripslashes(nl2br($message));
if ($capcha == 4) {
if (mb_eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,3}$", $mail) ) {
//header html
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
$headers .= 'From: "Stopinsectes.com"<[email protected]>'."\n";
$headers .= 'Bcc: [email protected],[email protected],[email protected]'."\n";
$reply = $headers.'Reply-to: [email protected]'."\n";
if( mail('[email protected]','Formulaire Stop Insectes', $html, $reply) ){
echo '<p><span class="blockquote">les informations on bien été envoyées</span></p>';
}
else{
echo '<p><span class="blockquote">La fonction mail() est désactivée sur ce serveur.</p>';
}
} else {
echo '<p><span class="blockquote">Veuillez vérifier votre adresse mail.</p>';
}
} else {
echo '<p><span class="blockquote">Veuillez vérifier le code de sécurité</p>';
}
?>
merci pour vos réponses.
je ne trouve pas pourquoi ce code ne marche pas avec IE
voici avec les balises
le formulaire est dans une page type
[php]<?php if (class_exists('MailPress')) MailPress::form(); ?>
<form id="myForm" method="POST" action="http://www.stopinsectes.com/wp-content/themes/StopFinal/send.php" name="formulaire">
<ul id="form">
<li class="simpleinput"><label>Nom complet:</label><input type="text" name="name"></input></li>
<li class="simpleinput"><label>Téléphone:</label><input type="text" name="tel"></input></li>
<li class="simpleinput"><label>Adresse:</label><input type="text" name="adresse"></input></li>
<li class="simpleinput"><label>Ville:</label><input type="text" name="ville"></input></li>
<li class="simpleinput"><label>Code Postal:</label><input type="text" name="codepostal"></input></li>
<li class="simpleinput"><label>Email:</label><input type="text" name="mail"></input></li>
<li><label>Je souhaite:</label>
<input type="checkbox" name="doc"></input> recevoir une documentation<br />
<input type="checkbox" name="appel"></input> la visite d'un commercial, pour un diagnostic<br />et un devis gratuit<br />
</li>
<li><label>Vous souhaitez nous rencontrer pour:</label></li>
<li><label>Insectes</label>
<input type="checkbox" name="desinsectisation"></input> désinsectisation<br />
<input type="checkbox" name="desinfection"></input> désinfection<br />
<input type="checkbox" name="demoustication"></input> démoustication<br />
<input type="checkbox" name="jardin"></input> traitement des jardins<br />
<input type="checkbox" name="denrees"></input> fumigation des denrées stockées<br />
</li>
<li><label>Rongeurs</label>
<input type="checkbox" name="deratisation"></input> dératisation
</li>
<li><label>Pigeons</label>
<input type="checkbox" name="depigeonnage"></input> dépigeonnage<br />
<input type="checkbox" name="chauvesouris"></input> chauve-souris<br />
</li>
<li><label>Termites</label>
<input type="checkbox" name="preventif"></input> traitement préventif<br />
<input type="checkbox" name="curatif"></input> traitement curatif<br />
<input type="checkbox" name="charpentes"></input> traitement des charpentes<br />
<input type="checkbox" name="art"></input> fumigation mobilier et objets d'art<br />
</li>
<li><label>Franchise</label>
<input type="checkbox" name="franchise"></input> merci de m'adresser votre documentation<br />
</li>
<li><label for=message>Commentaires:</label><textarea class="format" name="message" rows="4"></textarea></li>
<li class="simpleinput"><label>Sécurité:<span style="font-size:11px;"> (combien font 2 + 2?)</span></label><input type="text" name="capcha"></input></li>
<li><input id="send" type="image" src="<?php bloginfo('template_url'); ?>/img/boutonenvoyer.gif" width="77" height="22" value="submit" border="0" /></li>
</ul>
</form>
</div>
<?php } ?>[/php]
le fichier send.php
[php]<?php
// récupération des variables
$i=0;
foreach ($_POST as $key => $value){
if ($i == 0) {$allpost = '&'.$key.'='.$value;}
if ($i>0) {$allpost .= '&'.$key.'='.$value;}
$i++;
}
$name = $_POST['name'];
$tel = $_POST['tel'];
$adresse = $_POST['adresse'];
$ville = $_POST['ville'];
$mail = $_POST['mail'];
$codepostal = $_POST['codepostal'];
$capcha = $_POST['capcha'];
$doc = $_POST['doc'];
$appel = $_POST['appel'];
$desinsectisation = $_POST['desinsectisation'];
$desinfection = $_POST['desinfection'];
$demoustication = $_POST['demoustication'];
$jardin = $_POST['jardin'];
$denrees = $_POST['denrees'];
$deratisation1 = $_POST['deratisation'];
$depigeonnage = $_POST['depigeonnage'];
$chauvesouris = $_POST['chauvesouris'];
$preventif = $_POST['preventif'];
$curatif = $_POST['curatif'];
$charpentes = $_POST['charpentes'];
$art = $_POST['art'];
$franchise = $_POST['franchise'];
$message = $_POST['message'];
// On peuple
if (!empty($desinsectisation)) {$un = '<li>désinsectisation</li>'."\n";}
if (!empty($desinfection)) {$deux = '<li>désinfection</li>'."\n";}
if (!empty($demoustication)) {$trois = '<li>démoustication</li>'."\n";}
if (!empty($jardin)) {$quatre = '<li>traitement des jardins</li>'."\n";}
if (!empty($denrees)) {$onze = '<li>fumigation des denrées stockées</li>'."\n";}
if (!empty($deratisation)) {$cinq = '<li>deratisation</li>'."\n";}
if (!empty($depigeonnage)) {$six = '<li>depigeonnage</li>'."\n";}
if (!empty($chauvesouris)) {$sept = '<li>chauve-souris</li>'."\n";}
if (!empty($preventif)) {$huit = '<li>traitement préventif anti-termites</li>'."\n";}
if (!empty($curatif)) {$neuf = '<li>traitement curatif anti-termites</li>'."\n";}
if (!empty($charpentes)) {$douze = '<li>traitement des charpentes</li>'."\n";}
if (!empty($art)) {$treize = '<li>fumigation du mobilier et des objets d\'art</li>'."\n";}
if (!empty($franchise)) {$dix = '<li>demande d\'informations sur la franchise</li>'."\n";}
if (!empty($doc)) {$doc = 'oui';} else {$doc = 'non';}
if (!empty($appel)) {$appel = 'oui';} else {$appel = 'non';}
$html = '<h3>Données client :</h3><span style="text-transform:uppercase; font-size:large;">'.$name.'</span></strong><br />';
$html .= 'Téléphone: '.$tel.'<br />Adresse: '.$adresse.'<br />Ville: '.$ville.'<br/>Mail : <a href="mailto:'.$mail.'">'.$mail.'</a><br />Code Postal: '.$codepostal.'<br />';
$html .= 'Demande de documentation: '.$doc.'<br />';
$html .= 'Appeler le client pour un devis gratuit: '.$appel.'<br />';
$html .= '<h3>Rendez-vous souhaité:</h3><strong>Le client souhaite un rendez-vous pour:</strong><br />';
$html .= '<ul>'.$un.$deux.$trois.$quatre.$onze.$cinq.$six.$sept.$huit.$neuf.$douze.$treize.$dix.'</ul><br />';
$html .= '<h3>Commentaires : </h3>'.stripslashes(nl2br($message));
if ($capcha == 4) {
if (mb_eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,3}$", $mail) ) {
//header html
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
$headers .= 'From: "Stopinsectes.com"<
[email protected]>'."\n";
$headers .= 'Bcc:
[email protected],
[email protected],
[email protected]'."\n";
$reply = $headers.'Reply-to:
[email protected]'."\n";
if( mail('
[email protected]','Formulaire Stop Insectes', $html, $reply) ){
echo '<p><span class="blockquote">les informations on bien été envoyées</span></p>';
}
else{
echo '<p><span class="blockquote">La fonction mail() est désactivée sur ce serveur.</p>';
}
} else {
echo '<p><span class="blockquote">Veuillez vérifier votre adresse mail.</p>';
}
} else {
echo '<p><span class="blockquote">Veuillez vérifier le code de sécurité</p>';
}
?>[/php]
merci pour vos réponses.
je ne trouve pas pourquoi ce code ne marche pas avec IE