Problème formulaire de contact URGENT

Fermé
alex95643 Messages postés 93 Date d'inscription samedi 26 décembre 2009 Statut Membre Dernière intervention 20 mai 2014 - 1 janv. 2012 à 10:51
alex95643 Messages postés 93 Date d'inscription samedi 26 décembre 2009 Statut Membre Dernière intervention 20 mai 2014 - 1 janv. 2012 à 20:44
Bonjour,

J'ai un problème avec mon formulaire de contact créé automatiquement avec le logiciel web animé pro home 5. Le formulaire ne s'envoi pas sur ma boite email, une fois les champs remplies, je clique sur envoyer et tout est supprimer :


Voici le submit.php

?php

// Contact us Form
// Provided by A4Desk Flash Web Site Builder
// Website: https://www.a4desk.com/
//
// Note:
// Modifying this page without knowledge in PHP is not recommended.
//

// ========================================
// Settings
// ========================================

// basic settings
define(MAIL_TO, 'EMAIL SUPPRIMER SUR LE FORUM'); // your email address
define(MAIL_SUBJECT, 'Devis spectacle'); // mail subject showing in your mail box

// data checking options
define(IS_CHECK_EMPTY, true); // check if visitor fill in all required fields
define(IS_CHECK_DEFAULT, true); // check if visitor change default values
define(IS_CHECK_SPAM, true); // spam protection

define(DEFAULT_NAME, 'Your Name'); // works with option 'IS_CHECK_DEFAULT'
define(DEFAULT_MESSAGE, 'Type your message here'); // works with option 'IS_CHECK_DEFAULT'



// ========================================
// Check Required Fields
// ========================================

// default status
$valid = true;

// check is empty
if(IS_CHECK_EMPTY)
$valid = $valid && (trim($_POST['name'])!='') && (trim($_POST['email'])!='') && (trim($_POST['subject'])!='') && (trim($_POST['message'])!='');

// check is default value changed
// if(IS_CHECK_DEFAULT)
// $valid = $valid && (($_POST['name']!=DEFAULT_NAME) && ($_POST['message']!=DEFAULT_MESSAGE));

// check if there are spam content
if(IS_CHECK_SPAM)
$valid = $valid && is_content_safe($_POST);



// ========================================
// Send Email
// ========================================

// send message to your mail box, if data is valid
if($valid)
{
$message = sprintf("
========================================

Nom: %s

: %s

E-mail: %s

Téléphone: %s

Pays: %s

Ville: %s

Sujet: %s

Message:

%s

========================================
", $_POST['name'], $_POST['company'], $_POST['email'], $_POST['phone'], $_POST['country'], $_POST['city'], $_POST['subject'], $_POST['message']);

mail(MAIL_TO, MAIL_SUBJECT, $message, 'From: "'.trim(trim($_POST['name'],'<>:')).'" <'.trim(trim($_POST['email'],'<>:')).'>');
}


// ========================================
function is_content_safe($data)
{
// flatten data
$data_flat = serialize($data);
// spam keywords
$keyword = array();
$keyword[0] = 'Content-Type:';
$keyword[1] = 'MIME-Version:';
$keyword[2] = 'Content-Transfer-Encoding:';
$keyword[3] = 'Subject:';
$keyword[4] = 'bcc:';
$keyword[5] = '\[url=';
// check if keywords exist in content
for($a=0 ; $a<sizeof($keyword) ; $a++)
if(eregi($keyword[$a], $data_flat))
return false;
// content is safe
return true;
}


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Association les Jun's Magicos</title>
<style type="text/css">
<!--

body, div, p { font-family: arial, helvetica, sans-serif; font-size: 12px; color: #444444}
a, a:visited, a:active, a:hover { color: #ff0000 }

.message_box { background-color: #eeeeee; border: 1px #CCCCCC solid; margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px; width: 360px}
.message_title { background-color: #e0e0e0; font-weight: bold; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; color: #FFFFFF; border-color: black black #CCCCCC; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px}
.message_content { background-color: #eeeeee; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px}

#msg_error { background-color: #CC3333}
#msg_done { background-color: #3333CC}

-->
</style>
</head>
<body>

<?php
// show success message screen
if($valid) {
?>
<div class="message_box"><div class="message_title" id="msg_done">Message envoyé</div>
<div class="message_content">
<p>Merci pour votre message. Nous vous répondrons bientôt.</p>
<!-- <p align="center"><a href="javascript:window.close();">Close</a></p>-->
</div>
</div>
<?php
// show error message screen
} else {
?>
<div class="message_box">
<div class="message_title" id="msg_error">Erreur</div>
<div class="message_content">
<p>Impossible de soumettre votre demande. S'il vous plaît vérifier les détails que vous avez saisi et essayer à nouveau.</p>
<!-- <p align="center"><a href="javascript:history.go(-1);">Back</a></p>-->
</div>
</div>
<?php } ?>

</body>
</html>








Voici le test.php



<?php
if($_GET['action']=='phpinfo')
{ phpinfo(); exit; }
?>
<html>
<head>
<title>PHP Testing Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">
<!--
body, div, p { font-family: arial, helvetica, sans-serif; font-size: 12px; color: #444444}
a, a:visited, a:active, a:hover { color: #0000ff }

.message_box
{
background-color: #eeeeee;
border: 1px #CCCCCC solid;
margin: 5px;
padding-top: 20px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 20px;
width: 600px;
position: absolute;
top: 0px;
left: 0px;
}
.result { font-size: 24px; font-weight: bold; margin-top: 10px; margin-bottom: 10px}

#word_ok { color: #009900; }
#word_fail { color: #CC0000; }

#css_warn{ display: none; }

#msg_ok { display: none; }
#msg_fail { display: block; }

-->
</style>

<?php
echo '<style ';
echo 'type="text/css">';
echo "\n";
?>
<?php
echo '#msg_ok { display: block; }';
echo '#msg_fail { display: none; }';
echo '#notice { top: 120px; }';
echo '</st';
echo 'yle>';
?>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<div id="css_warn"><h1><font color="#ff0000">Please view this page with CSS turned on.</font></h1></div>

<div class="message_box" id="msg_ok"><span class="result">Your site <span id="word_ok">supports</span> PHP.</span>
<p><a href="test.php?action=phpinfo">Click here to view your PHP configuration.</a></p></div>

<div class="message_box" id="msg_fail"><span class="result">Your site <span id="word_fail">does not support</span> PHP.</span></div>



</body>
</html>



Merci d'avance pour votre aide
Alexandre


1 réponse

alex95643 Messages postés 93 Date d'inscription samedi 26 décembre 2009 Statut Membre Dernière intervention 20 mai 2014 2
1 janv. 2012 à 20:44
up du message !
0