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 152 153 154 155 156 157 158
| <html>
<head>
<title>Livre d'or</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Pragma" content="no-cache">
<link href="style.css" rel="stylesheet" type="text/css">
<script>
function test_form(expediteurID, messageID)
{
if(expediteurID.value=="")
{
alert('Vous devez saisir votre nom !')
expediteurID.focus();return false
}
if(messageID.value=="")
{
alert('Vous devez saisir un message !')
messageID.focus();return false
}
return true
}
</script>
</head>
<body background="images/background.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0" id="main">
<tr align="center" valign="top">
<td width="19" rowspan="3" background="images/background_left.gif" border="0"></td>
<td width="702" bgcolor="#FFFFFF">
<a href="home.php"><img src="images/logo_top.png" width="702" height="120" border="0"></a>
<table width="680" border="0" cellspacing="0" cellpadding="0" id="main">
<tr>
<td height="60" colspan="3" valign="bottom"><div align="center"><img src="images/logo_page_livre.png" width="680" height="40"></div></td>
</tr>
<tr>
<td height="30" colspan="3"><img src="images/bevel.png" width="680" height="20"></td>
</tr>
<tr>
<td height="30" width="680" colspan="3">
<?
include ("connexion.php");
if($test=="ok")
{
$Date = date("Y/m/d h:i:s");
$query = "INSERT INTO livre(codelivre, message, expediteur, email, site, age, ville, date)";
$query .= "VALUES('', '$messageID', '$expediteurID', '$emailID', '$siteID', '$ageID', '$villeID', '$Date')";
$result = mysql_query($query);
?>
</td>
</tr>
<tr>
<td height="30" width="680" colspan="3"><div align="center"><b>Votre message a été enregistré</b></div></td>
</tr>
<tr>
<td height="30" width="680" colspan="3"><div align="center"><a href="livre_or.php"><b>Lire les messages</b></a></div></td>
</tr>
<tr>
<td height="30" width="680" colspan="3">
<?
}
if ($test!="ok")
{
?>
<div align="center" class="text_title">Signer le livre d'or</div></td>
</tr>
<tr>
<td height="30" width="680" colspan="3"><img src="images/line_03.png" width="680" height="15"></td>
</tr>
<?
function randomkeys($length)
{
$pattern = '1234567890abcdefghijklmnopqrstuvwxyz';
for($i=0;$i<$length;$i++)
{
if(isset($key))
$key .= $pattern{rand(0,35)};
else
$key = $pattern{rand(0,35)};
}
return $key;
}
if (isset($_POST['spam_field'])) $spam_field = $_POST['spam_field']; else $spam_field = '';
if (isset($_POST['spam_field_protect'])) $spam_field_protect = $_POST['spam_field_protect']; else $spam_field_protect = '';
if ($spam_field == $spam_field_protect)
{
}
else
{
$anti_spam_text = "Pas de SPAM ici !<br>";
}
$anti_spam = randomkeys(5);
?>
<tr>
<td height="30" width="680" colspan="3"><div align="center">Avant de valider votre message, saisissez <b><? echo $anti_spam ?></b> dans le champ "Anti-Spam".</div></td>
</tr>
<tr>
<td width="15"></td>
<td width="650" height="30">
<form name="livre" method="post" onSubmit="return test_form(this.expediteurID, this.messageID)" action="livre_or_form.php?test=ok">
<input type="hidden" name="spam_field_protect" value="<? echo $anti_spam ?>">
<table width="650" border="0" cellpadding="0" cellspacing="0" id="main">
<tr>
<td height="15" colspan="2"></td>
</tr>
<tr>
<td width="180" height="35" valign="top">Votre nom</td>
<td width="470" height="35" valign="top"><input type="text" name="expediteurID" size="47" maxlength="50"></td>
</tr>
<tr>
<td width="180" height="35" valign="top">Votre adresse email</td>
<td width="470" height="35" valign="top"><input type="text" name="emailID" size="47" maxlength="50"></td>
</tr>
<tr>
<td width="180" height="35" valign="top">Votre site</td>
<td width="470" height="35" valign="top"><input type="text" name="siteID" size="47" maxlength="50"></td>
</tr>
<tr>
<td width="180" height="35" valign="top">Votre âge</td>
<td width="470" height="35" valign="top"><input name="ageID" type="text" size="2" maxlength="2"></td>
</tr>
<tr>
<td width="180" height="35" valign="top">Votre ville</td>
<td width="470" height="35" valign="top"><input type="text" name="villeID" size="47" maxlength="50"></td>
</tr>
<tr>
<td width="180" height="150" valign="top">Votre message</td>
<td width="470" height="150" valign="top"><textarea name="messageID" cols="35" rows="7"></textarea></td>
</tr>
<tr>
<td width="180" height="35" valign="top">Anti-Spam</td>
<td width="470" height="35" valign="top"><input name="spam_field" type="text" size="47" maxlength="30"></td>
</tr>
<tr>
<td height="30" colspan="2"><div align="center"><input type="submit" name="submit" value="Envoyer"></div></td>
</tr>
</table>
</form>
</td>
<td width="15"></td>
</tr>
<tr>
<td height="30" colspan="3" valign="bottom"><img src="images/bevel.png" width="680" height="20"></td>
</tr>
<tr>
<td height="50" colspan="3"><div align="center"><a href="livre_or.php"><img src="images/btn_previous.png" width="140" height="25" border="0"></a></div></td>
</tr>
</table>
<a href="home.php"><img src="images/logo_bottom.png" width="702" height="50" border="0"></a>
</td>
<td width="19" rowspan="3" background="images/background_right.gif" border="0"></td>
</tr>
</table>
<?
}
mysql_close();
?>
</body>
</html> |
Partager