Grazie per avere risposto,
non esistono dei esempi più semplici sono un principiante, sto creando un sito tutto da me ma sono arrivato a questo punto e non so piu andare avanti, potrei farlo con dreamweaver ma vorrei farlo io, appunto con qualche esempio piu semplice!
Vi sarei grato non di avere la soluzione gia fatta, ma se esiste un esempio seplice di pagenavigator!!
Grazie Michel
Codice PHP:
<?php require_once('Connections/test.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_foto = 10;
$pageNum_foto = 0;
if (isset($_GET['pageNum_foto'])) {
$pageNum_foto = $_GET['pageNum_foto'];
}
$startRow_foto = $pageNum_foto * $maxRows_foto;
mysql_select_db($database_test, $test);
$query_foto = "SELECT * FROM tb_foto";
$query_limit_foto = sprintf("%s LIMIT %d, %d", $query_foto, $startRow_foto, $maxRows_foto);
$foto = mysql_query($query_limit_foto, $test) or die(mysql_error());
$row_foto = mysql_fetch_assoc($foto);
if (isset($_GET['totalRows_foto'])) {
$totalRows_foto = $_GET['totalRows_foto'];
} else {
$all_foto = mysql_query($query_foto);
$totalRows_foto = mysql_num_rows($all_foto);
}
$totalPages_foto = ceil($totalRows_foto/$maxRows_foto)-1;
$queryString_foto = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_foto") == false &&
stristr($param, "totalRows_foto") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_foto = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_foto = sprintf("&totalRows_foto=%d%s", $totalRows_foto, $queryString_foto);
?>
<?php do { ?>
[img]image/thumbs/<?php echo $row_foto['FotoLink']; ?>[/img]
<?php } while ($row_foto = mysql_fetch_assoc($foto)); ?>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"><?php if ($pageNum_foto > 0) { // Show if not first page ?>
[url="<?php printf("]">First[/url]
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_foto > 0) { // Show if not first page ?>
[url="<?php printf("]">Previous[/url]
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_foto < $totalPages_foto) { // Show if not last page ?>
[url="<?php printf("]">Next[/url]
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_foto < $totalPages_foto) { // Show if not last page ?>
[url="<?php printf("]">Last[/url]
<?php } // Show if not last page ?>
</td>
</tr>
</table>
</p>
<?php
mysql_free_result($foto);
?>
Questo é il codice di dreamweaver si puo semplificare?