1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
| <?php
function formulaire($Nom="",$Email="",$Mes="") {
?>
</p>
<form action="contacts.php" method="post">
<table border="0" class="tour" cellspacing="0" cellpadding="10" align="center">
<tr class="unite">
<td class="h1" >Nom, Prénom :</td>
<td width="80%"><center>
<input type="text" name="Nom" size="30" value="<?php echo trim(htmlentities($Nom)) ?>" />
</center></td>
</tr>
<tr class="unite">
<td class="h1">E-mail :</td>
<td width="80%"><center>
<input type="text" name="Email" value="<?php echo trim(htmlentities($Email)) ?>" size="30" />
</center></td>
</tr>
<tr class="unite">
<td class="h1">Destinataire :</td>
<td width="80%"><center>
<SELECT name="des">
<OPTION VALUE="Webmaster">Webmaster</OPTION>
<OPTION VALUE="Lisa">Lisa</OPTION>
</SELECT>
</center></td>
</tr>
<tr class="unite">
<td valign="top" class="h1">Message :</td>
<td width="80%"><center>
<textarea name="Mes" alt="Mes" rows="10" cols="47" wrap="virtual"><?php echo trim(htmlentities($Mes)) ?></textarea>
</center></td>
</tr>
<tr class="unite">
<td> </td>
<td width="80%"> <center>
<br />
<input type="submit" name="Submit" value="Envoi" alt="Envoi" style="background-color:#FE99C2" title="Envoi de votre message" onMouseOver="this.style.color='#000000'" onMouseOut="this.style.color='#000000'" onMouseDown="this.style.color='#000000'" />
</center></td>
</tr>
</table>
<span class="h1">
<?
}
if(!isset($Nom)) {
formulaire();
}
else {
$vNom=trim(htmlentities($_POST["Nom"]));
$vEmail=trim(htmlentities($_POST["Email"]));
$vMes=trim(htmlentities($_POST["Mes"]));
$destinataire='funik@private.com';
$titre="[ F-P.com ] Contact";
$message="Provenance : $HTTP_REFERER\n";
$message.="Adresse IP : $REMOTE_ADDR,\n";
$message.="Navigateur : $HTTP_USER_AGENT\n";
$message.="Nom : $vNom\n";
$message.="E-mail : $vEmail\n";
$message.="Message : $vMes\n";
if (!eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-_.]?[0-9a-z])*\\.[a-z]{2,4}$",$vEmail) && ($erreur<>1)){
echo "<p class='h1red'>L'adresse e-mail n'est pas correcte !</p>";
$erreur=1;
}
if ($erreur==1) {
formulaire($Nom,$Email,$Mes);
}
else {
mail($destinataire,$titre,$message,"From: $vEmail") ;
echo "<p class='h1'>Votre message :</p>";
echo "<ul><li><span class='h1'>Nom : " . $vNom . "</span><br />";
echo "<li><span class='h1'>E-mail : " . $vEmail. "</span></li>";
echo "<li><span class='h1'>Message : " . $vMes. "</span></li>";
echo "<p class='h1'>a bien été envoyé. Nous vous remercions.</p>\n" ;
echo "<form name='boutons'><table border='0' cellspacing='0' cellpadding='0' width='90%' align='center'><tr><td><center>" ;
echo "<input type='button' name='accueil' alt='Accueil' value=\"Retour à la page d'accueil\" style='color:#000000;background-color:#FE99C2' onclick=\"location.href='http://www.monsite.com'\" onmouseover=\"this.style.color='#000000'\" onmouseout=\"this.style.color='#000000'\" onmousedown=\"this.style.color='#000000'\" />\n";
echo "</center></td><td></td></tr></table>";
}
}
?>
</span>
</form> |
Partager