Probléme de formulaire HTML et PHP
photopyro16.com
-
Nico_ Messages postés 1302 Statut Membre -
Nico_ Messages postés 1302 Statut Membre -
Bonjour,
j'ai un gros soucis avec mon site internet qui est également "mon outil de travail".
Je souhaite créer un envoi d'email via mon site mais je n'y arrive pas
Voici mon code html de ma page
<HMTL>
<html>
<head>
<title>Contact</title>
<style type="text/css">
A:link {
TEXT-DECORATION: none;
color: #FFFFFF;
}
A:active {
TEXT-DECORATION: none;
color: #FF0000;
}
A:visited {
TEXT-DECORATION: none;
color: #FFFFFF;
}
A:hover {
Font-Size : 12pt;
Color : #FF0000;
font-weight : bold;
Text-Decoration : None
}
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
background-image: url(photopyro16-16.JPG);
background-repeat: no-repeat;
background-position:center
}
.Style1 {
font-size: 60px
}
.Style3 {font-size: 36px}
.Style4 {font-size: 18px}
.Style28 {font-size: 24px}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body ONLOAD="document.formname.name.focus()">
<script language="JavaScript">
function description(texte) {
window.status = texte;
return true;
}
function effaceetat() {
window.status="";
}
</script>
<table border="0" cellpadding="0" width="100%" height="864">
<tr>
<th height="219" align="center" valign="middle"><p class="Style10 Style1">LE MONDE </p>
<p class="Style10 Style1">DES FEUX D'ARTIFICE</p></th>
</tr>
<tr>
<td height="32" align="center" valign="middle"><span class="Style23 Style3">Un Jardin dans la Nuit</span></td>
</tr>
<tr>
<td width="100%" height="38"><p align="center">_______________________________________________________________________________________________________</td>
</tr>
<tr>
<td width="100%" height="547"><div align="center">
<table width="1020">
<tr>
<td><div align="center" class="Style28"><strong><a href="index.html">Accueil</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Societe.html">Société</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Dates Utiles.html">Agenda</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Contact depannage.html">Contact</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Sponsors.html">Sponsors</a></strong></div></td>
</tr>
<tr>
<td width="204"><div align="center" class="Style28"><strong><a href="Photos.html">Photos</a></strong></div></td>
<td width="204"><div align="center" class="Style28"><strong><a href="Video.html">Video</a></strong></div></td>
<td width="204"><div align="center" class="Style28"><strong><a href="Wallpapers.html">Fonds d'écran</a></strong></div></td>
<td width="180"><div align="center" class="Style28"><strong><a href="Liens.html">Liens</a></strong></div></td>
<td width="204"><div align="center"><a href="Produits.html" class="Style28"><strong>Produits</strong></a></div></td>
</tr>
</table>
</div>
<p align="center">_______________________________________________________________________________________________________</p>
<p align="center" class="Style4">Si vous souhaitez envoyer une remarque ou si vous avez des questions
remplissez le formulaire ci-dessous ou envoyer moi un <a
href="mailto:photopyro16@gmail.com" onMouseOver="description('Contact'); return true;"
onmouseout="effaceetat();">E-mail</a> </p>
<form NAME="formname" METHOD="POST" ACTION="mail.php3">
<div align="center">
<input type="hidden" name="F_FROM" value="Webmaster">
<input type="hidden" name="F_TO"
value="photopyro16@gmail.com">
<input type="hidden" name="F_SUBJECT" value="Contact">
<input
type="hidden" name="F_TEMPLATE" value="reponse.txt">
<input type="hidden"
name="F_TEMPLATE2" value="lui.txt">
<input type="hidden" name="F_SENT" value="sent_ok.html">
<input
type="hidden" name="F_NOTSENT" value="sent_notok.html">
<u></div>
<p align="center"></u> </p>
<p align="center"><u><strong>Nom et Prénom</strong></u>
<strong>
<u>Entrer votre E-mail:</u></strong></p>
<p align="center"><input type="text" name="name" size="20">
<input type="text" name="email" size="20"></p>
<p align="center"><strong><u>Sujet:</u></strong></p>
<p align="center">
<center>
<input type="text" name="sujet" size="58">
</p>
<p align="center"><textarea rows="9" name="textfield" cols="50"></textarea></p>
<p align="center"><input type="submit" value="Envoyer" name="B1"><input type="reset" value="Effacer"
name="B2"></p>
</form> </td>
</tr>
<tr>
<td width="100%" height="16"><p align="center"><script type="text/javascript">
<!--
Xt_param = 's=326329&p=contact';
try {Xt_r = top.document.referrer;}
catch(e) {Xt_r = document.referrer; }
Xt_h = new Date();
Xt_i = '<img width="39" height="25" border="0" alt="" ';
Xt_i += 'src="https://logv144.xiti.com/hit.xiti?fh=1&%27+Xt_param;&Rdt=On
Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;}
document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');
//-->
</script>
<noscript>
<img width="39" height="25" src="https://logv144.xiti.com/hit.xiti?fh=1&s=326329&p=contact&Rdt=On" alt="WebAnalytics" />
</p></td>
</tr>
</table>
</body>
</html>
Maintenant voici le PHP
<?php
function file2go2($url){ print "<html>\n<head>\n<meta http-equiv=\"refresh\" content=\"0;URL=$url\">\n</head>\n</html>"; exit; }
if(!@fopen($F_TEMPLATE, "r")) file2go2($F_NOTSENT);
else $arr_t1 = @file( $F_TEMPLATE ); $nr_mail = 1;
if (! $F_TEMPLATE2 == "" && !@fopen($F_TEMPLATE2, "r")) file2go2($F_NOTSENT);
if (! $F_TEMPLATE2 == "" && @fopen($F_TEMPLATE2, "r")) $arr_t2 = @file( $F_TEMPLATE2 ); $nr_mail = 2;
$domail = 1;
while ($domail <= $nr_mail):
if ($domail == 1) $var2use = $arr_t1; else $var2use = $arr_t2;
for ($index = 0; $index < count($var2use); $index++)
{
$pattern = ereg("{{[A-z0-9_]*}}", $var2use[$index]);
if ($pattern)
{
$line = ereg_replace("{{","$",$var2use[$index]);
$line = ereg_replace("}}","",$line);
}
else
{
$line = $var2use[$index];
}
$line = addslashes($line) . "<br>";
eval( "\$line = \"$line\";" );
if ($index == 0 && $domail == 1) $linetot1 = $line;
elseif ($index > 0 && $domail == 1) $linetot1 .= $line;
if ($index == 0 && $domail == 2) $linetot2 = $line;
elseif ($index > 0 && $domail == 2) $linetot2 .= $line;
}
++$domail;
endwhile;
$mailit1 = @mail($F_TO, $F_SUBJECT, $linetot1, "From: $F_FROM \nMime-Version: 1.0\nContent-Type: text/html; charset=ISO-8859-1\nContent-Transfer-Encoding: 7bit");
if ($nr_mail == 2) $mailit2 = @mail($email, $F_SUBJECT, $linetot2, "From: $F_FROM\nMime-Version: 1.0\nContent-Type: text/html; charset=ISO-8859-1\nContent-Transfer-Encoding: 7bit");
if ($mailit1 = true) $sent = 1;
else $sent = 0;
if ($mailit2 = true) $sent = 2;
else $sent = 0;
if ($nr_mail == 1 && $sent == 1) file2go2($F_SENT);
if ($nr_mail == 1 && $sent == 0) file2go2($F_NOTSENT);
if ($nr_mail == 2 && $sent == 2) file2go2($F_SENT);
if ($nr_mail == 2 && $sent == 0) file2go2($F_NOTSENT);
?>
Je vous remercie par avance de votre aide
j'ai un gros soucis avec mon site internet qui est également "mon outil de travail".
Je souhaite créer un envoi d'email via mon site mais je n'y arrive pas
Voici mon code html de ma page
<HMTL>
<html>
<head>
<title>Contact</title>
<style type="text/css">
A:link {
TEXT-DECORATION: none;
color: #FFFFFF;
}
A:active {
TEXT-DECORATION: none;
color: #FF0000;
}
A:visited {
TEXT-DECORATION: none;
color: #FFFFFF;
}
A:hover {
Font-Size : 12pt;
Color : #FF0000;
font-weight : bold;
Text-Decoration : None
}
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
background-image: url(photopyro16-16.JPG);
background-repeat: no-repeat;
background-position:center
}
.Style1 {
font-size: 60px
}
.Style3 {font-size: 36px}
.Style4 {font-size: 18px}
.Style28 {font-size: 24px}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body ONLOAD="document.formname.name.focus()">
<script language="JavaScript">
function description(texte) {
window.status = texte;
return true;
}
function effaceetat() {
window.status="";
}
</script>
<table border="0" cellpadding="0" width="100%" height="864">
<tr>
<th height="219" align="center" valign="middle"><p class="Style10 Style1">LE MONDE </p>
<p class="Style10 Style1">DES FEUX D'ARTIFICE</p></th>
</tr>
<tr>
<td height="32" align="center" valign="middle"><span class="Style23 Style3">Un Jardin dans la Nuit</span></td>
</tr>
<tr>
<td width="100%" height="38"><p align="center">_______________________________________________________________________________________________________</td>
</tr>
<tr>
<td width="100%" height="547"><div align="center">
<table width="1020">
<tr>
<td><div align="center" class="Style28"><strong><a href="index.html">Accueil</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Societe.html">Société</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Dates Utiles.html">Agenda</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Contact depannage.html">Contact</a></strong></div></td>
<td><div align="center" class="Style28"><strong><a href="Sponsors.html">Sponsors</a></strong></div></td>
</tr>
<tr>
<td width="204"><div align="center" class="Style28"><strong><a href="Photos.html">Photos</a></strong></div></td>
<td width="204"><div align="center" class="Style28"><strong><a href="Video.html">Video</a></strong></div></td>
<td width="204"><div align="center" class="Style28"><strong><a href="Wallpapers.html">Fonds d'écran</a></strong></div></td>
<td width="180"><div align="center" class="Style28"><strong><a href="Liens.html">Liens</a></strong></div></td>
<td width="204"><div align="center"><a href="Produits.html" class="Style28"><strong>Produits</strong></a></div></td>
</tr>
</table>
</div>
<p align="center">_______________________________________________________________________________________________________</p>
<p align="center" class="Style4">Si vous souhaitez envoyer une remarque ou si vous avez des questions
remplissez le formulaire ci-dessous ou envoyer moi un <a
href="mailto:photopyro16@gmail.com" onMouseOver="description('Contact'); return true;"
onmouseout="effaceetat();">E-mail</a> </p>
<form NAME="formname" METHOD="POST" ACTION="mail.php3">
<div align="center">
<input type="hidden" name="F_FROM" value="Webmaster">
<input type="hidden" name="F_TO"
value="photopyro16@gmail.com">
<input type="hidden" name="F_SUBJECT" value="Contact">
<input
type="hidden" name="F_TEMPLATE" value="reponse.txt">
<input type="hidden"
name="F_TEMPLATE2" value="lui.txt">
<input type="hidden" name="F_SENT" value="sent_ok.html">
<input
type="hidden" name="F_NOTSENT" value="sent_notok.html">
<u></div>
<p align="center"></u> </p>
<p align="center"><u><strong>Nom et Prénom</strong></u>
<strong>
<u>Entrer votre E-mail:</u></strong></p>
<p align="center"><input type="text" name="name" size="20">
<input type="text" name="email" size="20"></p>
<p align="center"><strong><u>Sujet:</u></strong></p>
<p align="center">
<center>
<input type="text" name="sujet" size="58">
</p>
<p align="center"><textarea rows="9" name="textfield" cols="50"></textarea></p>
<p align="center"><input type="submit" value="Envoyer" name="B1"><input type="reset" value="Effacer"
name="B2"></p>
</form> </td>
</tr>
<tr>
<td width="100%" height="16"><p align="center"><script type="text/javascript">
<!--
Xt_param = 's=326329&p=contact';
try {Xt_r = top.document.referrer;}
catch(e) {Xt_r = document.referrer; }
Xt_h = new Date();
Xt_i = '<img width="39" height="25" border="0" alt="" ';
Xt_i += 'src="https://logv144.xiti.com/hit.xiti?fh=1&%27+Xt_param;&Rdt=On
Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;}
document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');
//-->
</script>
<noscript>
<img width="39" height="25" src="https://logv144.xiti.com/hit.xiti?fh=1&s=326329&p=contact&Rdt=On" alt="WebAnalytics" />
</p></td>
</tr>
</table>
</body>
</html>
Maintenant voici le PHP
<?php
function file2go2($url){ print "<html>\n<head>\n<meta http-equiv=\"refresh\" content=\"0;URL=$url\">\n</head>\n</html>"; exit; }
if(!@fopen($F_TEMPLATE, "r")) file2go2($F_NOTSENT);
else $arr_t1 = @file( $F_TEMPLATE ); $nr_mail = 1;
if (! $F_TEMPLATE2 == "" && !@fopen($F_TEMPLATE2, "r")) file2go2($F_NOTSENT);
if (! $F_TEMPLATE2 == "" && @fopen($F_TEMPLATE2, "r")) $arr_t2 = @file( $F_TEMPLATE2 ); $nr_mail = 2;
$domail = 1;
while ($domail <= $nr_mail):
if ($domail == 1) $var2use = $arr_t1; else $var2use = $arr_t2;
for ($index = 0; $index < count($var2use); $index++)
{
$pattern = ereg("{{[A-z0-9_]*}}", $var2use[$index]);
if ($pattern)
{
$line = ereg_replace("{{","$",$var2use[$index]);
$line = ereg_replace("}}","",$line);
}
else
{
$line = $var2use[$index];
}
$line = addslashes($line) . "<br>";
eval( "\$line = \"$line\";" );
if ($index == 0 && $domail == 1) $linetot1 = $line;
elseif ($index > 0 && $domail == 1) $linetot1 .= $line;
if ($index == 0 && $domail == 2) $linetot2 = $line;
elseif ($index > 0 && $domail == 2) $linetot2 .= $line;
}
++$domail;
endwhile;
$mailit1 = @mail($F_TO, $F_SUBJECT, $linetot1, "From: $F_FROM \nMime-Version: 1.0\nContent-Type: text/html; charset=ISO-8859-1\nContent-Transfer-Encoding: 7bit");
if ($nr_mail == 2) $mailit2 = @mail($email, $F_SUBJECT, $linetot2, "From: $F_FROM\nMime-Version: 1.0\nContent-Type: text/html; charset=ISO-8859-1\nContent-Transfer-Encoding: 7bit");
if ($mailit1 = true) $sent = 1;
else $sent = 0;
if ($mailit2 = true) $sent = 2;
else $sent = 0;
if ($nr_mail == 1 && $sent == 1) file2go2($F_SENT);
if ($nr_mail == 1 && $sent == 0) file2go2($F_NOTSENT);
if ($nr_mail == 2 && $sent == 2) file2go2($F_SENT);
if ($nr_mail == 2 && $sent == 0) file2go2($F_NOTSENT);
?>
Je vous remercie par avance de votre aide
A voir également:
- Probléme de formulaire HTML et PHP
- Whatsapp formulaire opposition - Guide
- Formulaire de réclamation facebook compte désactivé - Guide
- Formulaire de reclamation instagram - Guide
- Editeur html - Télécharger - HTML
- Easy php - Télécharger - Divers Web & Internet