quand je veut poste un commentaires grace au script si dessous et a phpmyadmin , le commentaires ne se poste pas WTH !!!!!
j'ai mis mon site sur internet grace a 1&1 !
voici mon script :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Livre d'amour</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css4.css" />
<style type="text/css">
form, .pages
{
text-align:center;
}
</style>
</head>
<body>
<form method="post" action="Tescom.php">
<p>
Pseudo : <input name="pseudo" /><br />
Message :<br />
<textarea name="message" rows="8" cols="35"></textarea><br />
<input type="submit" value="Envoyer" />
</p>
</form>
<p class="pages">
<?php
mysql_connect("*******", "*******", "******");
mysql_select_db("****");
if (isset($_POST['pseudo']) AND isset($_POST['message']))
{
$pseudo = mysql_real_escape_string(htmlspecialchars($_POST['pseudo']));
$message = mysql_real_escape_string(htmlspecialchars($_POST['message']));
$message = nl2br($message);
mysql_query("INSERT INTO Commentaires VALUES('', '" . $pseudo . "', '" . $message . "')");
}
$nombreDeMessagesParPage = 20;
$retour = mysql_query('SELECT COUNT(*) AS nb_messages FROM Commentaires');
$donnees = mysql_fetch_array($retour);
$totalDesMessages = $donnees['nb_messages'];
$nombreDePages = ceil($totalDesMessages / $nombreDeMessagesParPage);
echo 'Page : ';
for ($i = 1 ; $i <= $nombreDePages ; $i++)
{
echo '<a href="Tescom.php?page=' . $i . '">' . $i . '</a> ';
}
?>
</p>
<?php
if (isset($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = 1;
}
$premierMessageAafficher = ($page - 1) * $nombreDeMessagesParPage;
$reponse = mysql_query('SELECT * FROM Commentaires ORDER BY id DESC LIMIT ' . $premierMessageAafficher . ', ' . $nombreDeMessagesParPage);
while ($donnees = mysql_fetch_array($reponse))
{
echo '<p><strong>' . $donnees['pseudo'] . '</strong> a écrit :<br />' . $donnees['message'] . '</p>';
}
mysql_close();
?>
</body>
</html>
Merci d'avance !