Eléphanteau du PHP |
42 Messages
09 sept. 2006, 23:13
Le fichier include en question quel en est le code complet? parce que pour arriver à la ligne 154 je ne pense pas que ce soit suffisant

le dossier include et un peu plus ahut dans le topic
et si vous volez la page entiere la voila :
index.php
<?
$fp =fopen("courant.txt","a");
fputs ($fp, "-[ $REMOTE_ADDR || $HTTP_USER_AGENT ]-<br>\n");
fclose($fp);
?>
<?
include("ad_conf.inc.php");
?>
<html>
<head>
<title>Misoss - Greg, Blog</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<div align="center">
<img src="images/gfx_h__01.jpg" width="540" height="176" alt="">
<br><br><br>
<!-- Center -->
<table id="Tableau_01" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<img src="images/gfx__01.jpg" width="15" height="57" alt=""></td>
<td background="images/gfx__02.jpg" ></td>
<td>
<img src="images/gfx__03.jpg" width="18" height="57" alt=""></td>
<td>
<img src="images/gfx__04.jpg" width="13" height="57" alt=""></td>
<td background="images/gfx__05.jpg" ></td>
<td>
<img src="images/gfx__06.jpg" width="14" height="57" alt=""></td>
<tr>
<td colspan="2" background="images/gfx__08.jpg"></td>
<td background="images/gfx__09.jpg" valign="top">
<!-- Menu -->
<table id="Tableau_01" border="0" cellpadding="0" cellspacing="0"> <tr>
<td>
<img src="images/gfx_t__01.jpg" width="67" height="36" alt=""></td>
<td background="images/gfx_t__02.jpg" ><div align="center"><u>Menu:</u></div></td>
<td>
<img src="images/gfx_t__03.jpg" width="62" height="36" alt=""></td>
</tr>
</table>
<br>
<table id="Tableau_01" border="0" cellpadding="0" cellspacing="0" valign="top">
<tr>
<td> <img src="images/gfx_m__01.jpg" width="5" height="13" alt=""></td>
<td background="images/gfx_m__02.jpg"></td>
<td> <img src="images/gfx_m__03.jpg" width="13" height="13" alt=""></td>
</tr>
<tr>
<td background="images/gfx_m__05.jpg"></td>
<td>
<?
mysql_connect("$host", "$user", "$mdp");
mysql_select_db("$user");
$retour = mysql_query('SELECT * FROM menu_br ORDER BY id DESC');
while ($donnees = mysql_fetch_array($retour))
{
?>
<br><a href="<? echo $donnees['menu']; ?>" border="0" class="valid"><? echo $donnees['tmenu']; ?></a>
<?
}
// Fin de la boucle, le script est terminé !
?>
</td>
<td background="images/gfx_m__07.jpg" ></td>
</tr>
<tr>
<td> <img src="images/gfx_m__08.jpg" width="5" height="14" alt=""></td>
<td background="images/gfx_m__09.jpg" ></td>
<td><img src="images/gfx_m__10.jpg" width="13" height="14" alt=""></td>
</tr>
</table>
<!-- End Menu -->
<br>
<br>
<!-- Menu -->
<table id="Tableau_01" border="0" cellpadding="0" cellspacing="0"> <tr>
<td>
<img src="images/gfx_t__01.jpg" width="67" height="36" alt=""></td>
<td background="images/gfx_t__02.jpg" ><div align="center"><u>Partenaires:</u></div></td>
<td>
<img src="images/gfx_t__03.jpg" width="62" height="36" alt=""></td>
</tr>
</table>
<br>
<table id="Tableau_01" border="0" cellpadding="0" cellspacing="0" valign="top">
<tr>
<td> <img src="images/gfx_m__01.jpg" width="5" height="13" alt=""></td>
<td background="images/gfx_m__02.jpg"></td>
<td> <img src="images/gfx_m__03.jpg" width="13" height="13" alt=""></td>
</tr>
<tr>
<td background="images/gfx_m__05.jpg"></td>
<td>
<?
mysql_connect("$host", "$user", "$mdp");
mysql_select_db("$user");
$retour = mysql_query('SELECT * FROM lien_br ORDER BY id DESC');
while ($donnees = mysql_fetch_array($retour))
{
?>
<br><a href="<? echo $donnees['lien']; ?>" border="0" class="valid"><? echo $donnees['tlien']; ?></a>
<?
}
// Fin de la boucle, le script est terminé !
?>
</td>
<td background="images/gfx_m__07.jpg" ></td>
</tr>
<tr>
<td> <img src="images/gfx_m__08.jpg" width="5" height="14" alt=""></td>
<td background="images/gfx_m__09.jpg" ></td>
<td><img src="images/gfx_m__10.jpg" width="13" height="14" alt=""></td>
</tr>
</table>
<!-- End Menu -->
</td>
<td background="images/gfx__10.jpg"></td>
<td background="images/gfx__11.jpg"></td>
<td background="images/gfx__12.jpg">
<?
mysql_connect("$host", "$user", "$mdp");
mysql_select_db("$user");
// --------------- Etape 1 -----------------
// Si un message est envoyé, on l'enregistre
// -----------------------------------------
if (isset($_POST['titre']) AND isset($_POST['img']) AND isset($_POST['message']))
{
$titre = htmlentities($_POST['titre'], ENT_QUOTES); // On utilise htmlentities par mesure de sécurité
$img = ($_POST['img'], ENT_QUOTES);
$message = htmlentities($_POST['message'], ENT_QUOTES); // De même pour le message
$message = nl2br($message); // Pour le message, comme on utilise un textarea, il faut remplacer les Entrées par des <br />
// On peut enfin enregistrer :o)
mysql_query("INSERT INTO blog_br VALUES('', '" . $titre . "', '" . $img . "', '" . $message . "')");
}
// --------------- Etape 2 -----------------
// On écrit les liens vers chacune des pages
// -----------------------------------------
// On met dans une variable le nombre de messages qu'on veut par page
$nombreDeMessagesParPage = 20; // Essayez de changer ce nombre pour voir :o)
// On récupère le nombre total de messages
$retour = mysql_query('SELECT COUNT(*) AS nb_messages FROM titre_br');
$donnees = mysql_fetch_array($retour);
$totalDesMessages = $donnees['nb_messages'];
// On calcule le nombre de pages à créer
$nombreDePages = ceil($totalDesMessages / $nombreDeMessagesParPage);
// Puis on fait une boucle pour écrire les liens vers chacune des pages
echo 'Page : ';
for ($i = 1 ; $i <= $nombreDePages ; $i++)
{
echo '<a href="index.php?page=' . $i . '">' . $i . '</a> ';
}
?>
</p>
<?php
// --------------- Etape 3 ---------------
// Maintenant, on va afficher les messages
// ---------------------------------------
if (isset($_GET['page']))
{
$page = $_GET['page']; // On récupère le numéro de la page indiqué dans l'adresse (index.php?page=4)
}
else // La variable n'existe pas, c'est la première fois qu'on charge la page
{
$page = 1; // On se met sur la page 1 (par défaut)
}
// On calcule le numéro du premier message qu'on prend pour le LIMIT de MySQL
$premierMessageAafficher = ($page - 1) * $nombreDeMessagesParPage;
$reponse = mysql_query('SELECT * FROM blog_br ORDER BY id DESC LIMIT ' . $premierMessageAafficher . ', ' . $nombreDeMessagesParPage);
while ($donnees = mysql_fetch_array($reponse))
{
echo '
<table style="text-align: left; width: 100px;" border="1"
cellpadding="0" cellspacing="1">
<tbody>
<tr>
<td colspan="2" rowspan="1"><u><b>' . $donnees['titre'] . '</b></u> :</td>
</tr>
<tr>
<td><img src="images/' . $donnees['img'] . '" border="0"></td>
<td>' . $donnees['message'] . '</td>
</tr>
</tbody>
</table>
<br>';
}
mysql_close(); // On n'oublie pas de fermer la connexion à MySQL ;o)
?>
</td>
<td background="images/gfx__13.jpg"></td>
</tr>
<tr>
<td>
<img src="images/gfx__14.jpg" width="1" height="66" alt=""></td>
<td>
<img src="images/gfx__15.jpg" width="14" height="66" alt=""></td>
<td background="images/gfx__16.jpg"></td>
<td>
<img src="images/gfx__17.jpg" width="18" height="66" alt=""></td>
<td>
<img src="images/gfx__18.jpg" width="13" height="66" alt=""></td>
<td background="images/gfx__16.jpg"></td>
<td>
<img src="images/gfx__20.jpg" width="14" height="66" alt=""></td>
</tr>
<tr>
</table>
<!-- End Center -->
</div>
</body>
</html>