nella pagina della tabella io metto
Codice PHP:
<?php
$maxRows_Recordset1 = 5;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_local, $local);
$query_Recordset1 = "SELECT * FROM articoli ORDER BY id DESC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $local) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento senza titolo</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<?php do { ?>
<table width="57%" border="1">
<tr>
<td><a href="news.php?id=<?php $row['id'] ?>";>
<?php echo $row_Recordset1['titolo']; ?></a>
</td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
nella pagina news.php metto
Codice PHP:
<?php
$row=$_GET['id'];
mysql_select_db($database_local, $local);
$query_Recordset1 = "SELECT * FROM articoli WHERE row=$id";
$Recordset1 = mysql_query($query_Recordset1, $local) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php include ("phpstruttura/menu.php"); ?>
<?php include ("phpstruttura/linkbanner.php"); ?>
<html>
<head><link rel=stylesheet href=style.css>
</head>
<body>
<table border=0 class=struttura cellspacing=0 cellpadding=0 >
<tr>
<td class=menutop colspan="3" ><?php echo "$menutop" ?></td>
</tr><tr>
<td class=banner colspan=3 ></td>
</tr>
<tr><td colspan=3 height=10 bgcolor="#000000" ><em><a href=index.php?><div class=home>HOME</div></a></em></td></tr>
<tr>
<td class=sinistra valign=top align="center"><?php echo $menu ?> <?php echo $menusezioni ?></td>
<td class=centro valign=top rowspan=2>
<p align="center" class="titolo"><strong><?php echo $row_Recordset1['titolo']; ?></strong></p>
<p class="testo"><?php echo $row_Recordset1['testo']; ?></p></td>
<td class=destra valign=top rowspan=2 ><?php echo $link ?></td>
</tr>
<tr><td class=sinistra bgcolor="#FFFFFF" ></td><td></td><td></td></tr>
<tr><td class=footersx width=150px></td><td class="footercen" width=550></td><td class=footerdx width=200></td></tr>
</table>
<p class="titolo"> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
[DS] Usa i tag di codice, e non i tag QUOTE, quando ne riporti ampi stralci... si legge meglio, e non esce un post kilometrico