Código PHP:
<?php
$mailSent = false;
$missingInfo = false;
if($_REQUEST['formSubmitted'] == "true")
{
$to = "[email protected]";
$subject = "Form. SOS Banque";
if($_REQUEST['f_objet'] != "")
$subject .= " (".$_REQUEST['f_objet'].")";
$message = "Contenu du formulaire:\n\nCivilite: ".$_REQUEST['f_civilite']."\nNom: ".$_REQUEST['f_nom']."\nPrenom: ".$_REQUEST['f_prenom']."\n\n";
$message .= "Tel fixe: ".$_REQUEST['f_fixe']."\nTel portable: ".$_REQUEST['f_portable']."\nEmail: ".$_REQUEST['f_email']."\n\nObjet: ".$_REQUEST['f_objet']."\n\nMessage:\n".$_REQUEST['f_message']."\nFIN DU MESSAGE";
$missingInfo = true;
$missingContact = $_REQUEST['f_fixe'] == "" && $_REQUEST['f_portable'] == "" && $_REQUEST['f_email'] == "";
$missingName = $_REQUEST['f_prenom'] == "" && $_REQUEST['f_nom'] == "";
if(!$missingContact && !$missingName)
$mailSent = mail($to,$subject,$message);
else
$missingInfo = false;
}
Código HTML:
]?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Contact - SOS Banque</title> <style type="text/css"> <!-- .Estilo10 { color: #2C3CFE; font-weight: bold; } .Estilo12 {font-family: Calibri} .Estilo13 {font-size: 16px} .Estilo2 {font-family: Calibri; font-size: 18px; font-weight: bold; } body { background-color: #D6D6D6; } a:visited { color: #1C3251; } .Estilo14 { font-family: Calibri; font-size: 24px; font-weight: bold; } .Estilo19 { color: #3865a2; font-size: 28px; } a:link { color: #1C3251; } .Estilo23 { font-size: 30px; color: #3865a2; font-weight: bold; } .Estilo24 {color: #2C3CFE} .Estilo25 { color: #3865a2; font-weight: bold; font-size: 20px; } .Estilo4 { font-family: Calibri; font-size: 18px; color: #6773FE; } .Estilo26 {font-family: Calibri; font-size: 16px; } .Estilo28 { font-size: 18; font-weight: bold; } .Estilo30 {font-family: Calibri; font-size: 18px; } a:hover { color: #1C3251; } a:active { color: #1C3251; } --> </style> </head> <body> <table width="832" height="740" border="0" align="center"> <tr> <td width="891" align="center" valign="top" bgcolor="#FFFFFF"><table width="802" height="161" border="0"> <tr> <td width="263" bgcolor="#FFFFFF"><img src="lo22.gif" alt="x" width="262" height="121" align="left" /></td> <td width="526" bgcolor="#FFFFFF"><img src="bbbbb.gif" alt="x" width="523" height="123" align="right" /></td> </tr> </table> <table width="802" border="0"> <tr> <td height="91" align="center"><p class="Estilo10"><span class="Estilo4"><span class="Estilo24"><span class="Estilo23">OUVERTURE DE COMPTES BANCAIRES EN ESPAGNE</span></span> <br /> <br /> <span class="Estilo24"><span class="Estilo25">LEADER EN SOLUTIONS BANCAIRES POUR RÉSIDENT , NON RÉSIDENT OU INTERDIT BANCAIRE EN FRANCE</span></span></span><br /> <br /> <br /> </p> </td> </tr> </table> <table width="802" height="478" border="0" align="center"> <tr> <td width="215" align="left" valign="top" bgcolor="#FFFFFF"><p class="Estilo28"> </p> <p class="Estilo28"><br /> <span class="Estilo30"><a href="index.html">ACCUEIL</a></span></p> <p><span class="Estilo2"><a href="http://www.votre-societe-en-espagne.com" target="_blank">CRÉER VOTRE SOCIÉTÉ EN ESPAGNE </a></span> </p> <p> </p>
Código PHP:
<?php if($mailSent){?>
Código HTML:
<td width="577" align="left" valign="top" bgcolor="#FFFFFF"><p class="Estilo14"> <span class="Estilo17 Estilo19">CONTACT:</span></p> <p class="Estilo30"><strong>Contactez nous et nous vous répondrons dans les plus brefs délais.</strong></p> <p class="Estilo26">Téléphone : +34 93 587 8077 <br /> Fax : +34 93 589 2415</p> <p class="Estilo13"> </p> <p><span class="Estilo18 Estilo12 Estilo13">Le message nous a été envoyé,nous vous contacterons dans les plus brefs délais.Merci. </span><br /> <br /> <br /> <br /> <br /> <br /> <br /> </p> </td>
Código PHP:
<?php }else{?>
Código HTML:
<td width="577" align="left" valign="top" bgcolor="#FFFFFF"><p class="Estilo14"> <span class="Estilo19">CONTACT:</span></p> <p class="Estilo30"><strong>Contactez nous et nous vous répondrons dans les plus brefs délais.</strong></p> <p class="Estilo26">Téléphone : +34 93 587 8077 <br /> Fax : +34 93 589 2415</p> <span class="Estilo13"><br />
Código PHP:
<?php if($missingContact){?>
Código HTML:
<p class="Estilo26">Veuillez nous donner une adresse e-mail ou un numero de téléphone pour que nous puissions vous répondre. </p> <span class="Estilo13">
Código PHP:
<?php } if($missingName){?>
Código HTML:
</span> <p class="Estilo26">Veuillez nous donner un nom ou un prénom pour que nous sachions comment vous appeler. </p>
Código PHP:
<?php } ?>
Código HTML:
<form id="registro" name="registro" method="post" action="?"> <table width="519" border="0" align="left"> <tr> <td width="131" align="right"><span class="Estilo12">Civilité:</span><input name="formSubmitted" type="hidden" id="formSubmitted" value="true" /></td> <td width="522"><input name="f_civilite" type="radio" value="Mr." /> <span class="Estilo12">Mr</span> <input name="f_civilite" type="radio" value="Mlle." /> <span class="Estilo12">Mlle </span> <input name="f_civilite" type="radio" value="Mme." /> <span class="Estilo12">Mme</span></td> </tr> <tr> <td align="right"><span class="Estilo12"> Nom: </span></td> <td> <input name="f_nom" type="text" id="f_nom" size="53"
Código PHP:
<?php if(!$mailSent){?>value="<? echo $_REQUEST['f_nom'];?>" <?php } ?>/
Código HTML:
td> </tr> <tr> <td align="right"><span class="Estilo12"> Prénom: </span></td> <td> <input name="f_prenom" type="text" id="f_prenom" size="53"
Código PHP:
<?php if(!$mailSent){?>value="<? echo $_REQUEST['f_prenom'];?>" <?php } ?>
Código HTML:
/td> </tr> <tr> <td align="right"><span class="Estilo12"> Téléphone Fixe: </span></td> <td> <input name="f_fixe" type="text" id="f_fixe" size="53"
Código PHP:
<?php if(!$mailSent){?>value="<? echo $_REQUEST['f_fixe'];?>" <?php } ?>/
</tr>
<tr>
<td align="right"><span class="Estilo12">
Téléphone Portable:
</span></td>
<td>
<input name="f_portable" type="text" id="f_portable" size="53" [/HTML
Código PHP:
]<?php if(!$mailSent){?>value="<? echo $_REQUEST['f_portable'];?>" <?php } ?>/
Código HTML:
td> </tr> <tr> <td align="right"><span class="Estilo12"> E-mail: </span></td> <td> <input name="f_email" type="text" id="f_email" size="53"
Código PHP:
<?php if(!$mailSent){?>value="<? echo $_REQUEST['f_email'];?>" <?php } ?>/
</tr>
<tr>
<td align="right"><span class="Estilo12">
Objet:
</span></td>
<td>
<input name="f_objet" type="text" id="f_objet" size="53" [/HTML
Código PHP:
]<?php if(!$mailSent){?>value="<? echo $_REQUEST['f_objet'];?>" <?php } ?>/
Código HTML:
td> </tr> <tr> <td align="right" valign="top"><span class="Estilo26"> Message: </span></td> <td> <textarea name="f_message" cols="40" rows="7" id="f_message"
Código PHP:
<?php if(!$mailSent){ echo $_REQUEST['f_message']; } ?>
Código HTML:
textarea></td> </tr> <tr> <td align="right"> </td> <td align="left"> <input type="submit" name="Submit" value="Envoyer" id="Submit" /></td> </tr> </table> </form> </td>
Código PHP:
<?php } ?>
</table></td>
</tr>
</table>[/HTML</body>
</html>