Formulaire php marche avec ie, pas avec ff
sly
-
avion-f16 Messages postés 19182 Date d'inscription Statut Contributeur Dernière intervention -
avion-f16 Messages postés 19182 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
le script php fonctionne avec IE mais pas avec Firefox : avez vous une idée pourquoi. (pas d'erreur mais pas de mail reçu; hébergement sur 1&1)
code ci-dessous :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
<html xmlns="http://www.w3.org/1999/xhtml"><he…
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta name="ROBOTS" content="index,nofollow" />
<meta name="GENERATOR" content="MSHTML 6.00.2900.3314" />
</head>
<body>
<table>
<tbody>
<tr>
<td><small>
<?php // declare values
$contact_email = $_POST['EmailAddress'];
$contact_name = $_POST['FullName'];
$contact_origin = $_POST['Origin'];
$contact_message = $_POST['Message'];
$mydate = date ( 'l, F d Y g:i A',time()+240 );
// where to send e-mail to
$to = 'react2000@yahoo.fr;
// e-mail subject
$subject = "Exit Survey";
// e-mail message
$message = "Exit Survey:\r\n"
."------------------------------------…
."Contact Name: $contact_name\r\n"
."Submitted: $mydate\r\n"
."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."From origin: $contact_origin\r\n"
."Message: $contact_message\r\n\r\n"
."Form Address: {$_SERVER['SERVER_NAME']}{$_SERVER['REQU…
$headers = "From: $contact_name <$contact_email>\n"
."Reply-To: $contact_email\n"
."X-Mailer: PHP/".phpversion();
// check for validation, then send the e-mail
if(empty($contact_name) || empty($contact_email) || empty($contact_origin) || empty($contact_message)) {
echo '
<b><img alt="" src="images/thankyou.gif" align="right" height="386" width="263">Thank
you for coming to our website today. To help us understand why you have
choosen not to buy please just take 30 seconds of your time to answer the few
questions below. </b>
<form method="post" action=""><table id="Form-Details">
<tbody>
<tr>
<td><small><font face="Arial"><b>Name
: </b></font></small><input name="FullName" size="20" type="text"></td>
</tr>
<tr>
<td><small><font face="Arial"><b>Email
: </b></font></small><input name="EmailAddress" size="20" type="text"></td>
</tr>
<tr>
<td><small><font face="Arial"><b>Where
did you hear about our product
:</b></font></small></td>
</tr>
<tr>
<td colspan="3"><input name="Origin" size="30" type="text"></td>
</tr>
<tr>
<td colspan="4"><small><font face="Arial"><b>The
reason you leave without purchasing
:</b></font></small></td>
</tr>
<tr>
<td colspan="4"><font face="Arial"><textarea rows="6" name="Message" cols="38" class="input"></textarea></font></td>
</tr>
<tr>
<td colspan="4" class="right1"><font face="Arial"><input value="Submit" type="submit"><input value="Reset" type="reset"></font></td>
</tr>
</tbody>
</table>
</form>
';
} elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+… $contact_email)) {
echo "<p>ERROR: Please enter a valid e-mail address.</p>";
} else {
mail( $to, $subject, $message, $headers );
echo "<h3>Thank you for your time!</h3><p>Dear $contact_name,
We will send you our special report as soon as possible using $contact_email.<p><p><p><p><p><p><p><p><… }
?>
</td>
</tr>
</tbody>
</table>
</span></font></div>
</body></html>
le script php fonctionne avec IE mais pas avec Firefox : avez vous une idée pourquoi. (pas d'erreur mais pas de mail reçu; hébergement sur 1&1)
code ci-dessous :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
<html xmlns="http://www.w3.org/1999/xhtml"><he…
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta name="ROBOTS" content="index,nofollow" />
<meta name="GENERATOR" content="MSHTML 6.00.2900.3314" />
</head>
<body>
<table>
<tbody>
<tr>
<td><small>
<?php // declare values
$contact_email = $_POST['EmailAddress'];
$contact_name = $_POST['FullName'];
$contact_origin = $_POST['Origin'];
$contact_message = $_POST['Message'];
$mydate = date ( 'l, F d Y g:i A',time()+240 );
// where to send e-mail to
$to = 'react2000@yahoo.fr;
// e-mail subject
$subject = "Exit Survey";
// e-mail message
$message = "Exit Survey:\r\n"
."------------------------------------…
."Contact Name: $contact_name\r\n"
."Submitted: $mydate\r\n"
."From IP: {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
."From origin: $contact_origin\r\n"
."Message: $contact_message\r\n\r\n"
."Form Address: {$_SERVER['SERVER_NAME']}{$_SERVER['REQU…
$headers = "From: $contact_name <$contact_email>\n"
."Reply-To: $contact_email\n"
."X-Mailer: PHP/".phpversion();
// check for validation, then send the e-mail
if(empty($contact_name) || empty($contact_email) || empty($contact_origin) || empty($contact_message)) {
echo '
<b><img alt="" src="images/thankyou.gif" align="right" height="386" width="263">Thank
you for coming to our website today. To help us understand why you have
choosen not to buy please just take 30 seconds of your time to answer the few
questions below. </b>
<form method="post" action=""><table id="Form-Details">
<tbody>
<tr>
<td><small><font face="Arial"><b>Name
: </b></font></small><input name="FullName" size="20" type="text"></td>
</tr>
<tr>
<td><small><font face="Arial"><b>Email
: </b></font></small><input name="EmailAddress" size="20" type="text"></td>
</tr>
<tr>
<td><small><font face="Arial"><b>Where
did you hear about our product
:</b></font></small></td>
</tr>
<tr>
<td colspan="3"><input name="Origin" size="30" type="text"></td>
</tr>
<tr>
<td colspan="4"><small><font face="Arial"><b>The
reason you leave without purchasing
:</b></font></small></td>
</tr>
<tr>
<td colspan="4"><font face="Arial"><textarea rows="6" name="Message" cols="38" class="input"></textarea></font></td>
</tr>
<tr>
<td colspan="4" class="right1"><font face="Arial"><input value="Submit" type="submit"><input value="Reset" type="reset"></font></td>
</tr>
</tbody>
</table>
</form>
';
} elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+… $contact_email)) {
echo "<p>ERROR: Please enter a valid e-mail address.</p>";
} else {
mail( $to, $subject, $message, $headers );
echo "<h3>Thank you for your time!</h3><p>Dear $contact_name,
We will send you our special report as soon as possible using $contact_email.<p><p><p><p><p><p><p><p><… }
?>
</td>
</tr>
</tbody>
</table>
</span></font></div>
</body></html>
2 réponses
-
bonsoir,
le php n'a rien a voir avec ie ou firefox... si ca merde ça vient soit du html soit du css ou du js , pour le reste peu importe le navigateur... -
On en voit de toutes les sortes : formulaire html, css, php, sql, ... !
Un formulaire, c'est du (x)HTML et rien d'autre (ou tu XML avec XForm).
Où est l'erreur dans le HTML ?
- Tu utilises des tableaux pour l'alignement
- Tu utilises des balises obsolètes (small, font, b, ...).
- C'est quoi ce bordel ? :We will send you our special report as soon as possible using $contact_email.<p><p><p><p><p><p><p><p>
Va apprendre à coder.