Ciao a tutti!![]()
Ho una pagina php dove visualizzo le news che ho inserito.
Tutte le news sono riportate tutte nella stessa pagina.
Come posso suddividerle in 15 news per pagina?![]()
Questo è il codice della pagina news.php:
<?PHP include("../config.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<link rel="STYLESHEET" type="text/css" href="default.css">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#FFFFFF" vlink="#CCCCCC" alink="#FFFFFF">
<?PHP
// get the current news items
$query = "Select * from ".$DBprefix."news ORDER BY 'postDate' DESC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
?>
<hr align="center" color="157B30">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="157b30">
<td colspan="3">
<div align="center"> <font color="#FFFFFF">
<?PHP echo $row["title"]; ?>
</font><font color="#FFFFFF"> </font> </div>
</td>
</tr>
<tr>
<td></td>
<td width="98%"><?PHP echo $row["message"]; ?></td>
<td></td>
</tr>
<tr>
<td colspan="3" height="45">
<div align="right"><a messages.php?action=compose" target="_blank"><font color="#000000">CONTATTA
L'AUTORE </font></a> <font color="#FFFFFF">--------------------------------------------------
</font>Inserito da
<?PHP echo $row["poster"]; ?>
il
<?PHP echo $row["postDate"]; ?>
</div>
</td>
</tr>
</table>
<?php
// and very important end the while loop
}
?></table>
</body>
</html>