Il y a actuellement 401 visiteurs
Lundi 04 Mai 2026
accueilactualitésdossierscomparer les prixtélécharger gratuitement vos logicielsoffres d'emploiforum informatique
Connexion
Créer un compte

Code PHP, commentaires !!! HELP !!!!

Besoin d'aide pour configurer un serveur ? Vous souhaitez obtenir des conseils pour référencer votre site ? Un petit souci pour accéder à votre FTP ? Des soucis de programmation en PHP / ASP / HTML / XHTML / XML / XSLT / CSS / ReactJS / AngularJS / VueJS / CGI / PERL / C / MySQL / PostgreSQL ??? Nous avons peut-être la solution dans ce forum ...

Code PHP, commentaires !!! HELP !!!!

Message le 02 Mar 2012 18:37

voila aucune erreur a pars un seule petit soucie qui fais grave chier !!!!
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 ! :wink:
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 ! :D
TheDuke37100
Visiteur
Visiteur
 
Messages: 1
Inscription: 02 Mar 2012 18:29
 



Sujets similaires

Message LemFi Referral Code UK (SHRUTSFT): Grab £50 Cashback Instant
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0

Message LemFi Referral Code UK (SHRUTSFT): Claim £45 Bonus on Your F
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0

Message LemFi Referral Code UK (SHRUTSFT): Earn £40 Reward in Minute
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0

Message LemFi Referral Code UK (SHRUTSFT): Get £35 Bonus When You Sh
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0

Message LemFi Referral Code UK (SHRUTSFT): Refer & Enjoy £30 Cashbac
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0

Message LemFi Referral Code UK (SHRUTSFT): Unlock £25 Bonus on First
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0

Message LemFi Referral Code UK (SHRUTSFT): Send Money & Claim £20 Bo
"In a world where money travels faster than ever, finding a reliable and rewarding platform for international transfers feels like discovering a shortcut through a financial maze. Lemfi is one such platform quietly gaining popularity in the UK, offering fast, secure, and low-cost transfers. But ...
Réponses: 0


Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 4 invités


.: Nous contacter :: Flux RSS :: Données personnelles :.