j'ai essayé mais ça ne fontionne pas. Encore une fois je suis en région répétée avec une page principale liée à une page détail. voici le code ma page principale.
<?php require_once('Connections/ag3cconnec.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_annonces = 2;
$pageNum_annonces = 0;
if (isset($_GET['pageNum_annonces'])) {
$pageNum_annonces = $_GET['pageNum_annonces'];
}
$startRow_annonces = $pageNum_annonces * $maxRows_annonces;
mysql_select_db($database_ag3cconnec, $ag3cconnec);
$query_annonces = "SELECT * FROM produits";
$query_limit_annonces = sprintf("%s LIMIT %d, %d", $query_annonces, $startRow_annonces, $maxRows_annonces);
$annonces = mysql_query($query_limit_annonces, $ag3cconnec) or die(mysql_error());
$row_annonces = mysql_fetch_assoc($annonces);
if (isset($_GET['totalRows_annonces'])) {
$totalRows_annonces = $_GET['totalRows_annonces'];
} else {
$all_annonces = mysql_query($query_annonces);
$totalRows_annonces = mysql_num_rows($all_annonces);
}
$totalPages_annonces = ceil($totalRows_annonces/$maxRows_annonces)-1;
$queryString_annonces = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_annonces") == false &&
stristr($param, "totalRows_annonces") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_annonces = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_annonces = sprintf("&totalRows_annonces=%d%s", $totalRows_annonces, $queryString_annonces);
?><!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>Agence des 3 communes</title>
<link href="styles/fond.css" rel="stylesheet" type="text/css" />
<link href="styles/bord.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #CC6600;
}
a:visited {
color: #CC6600;
}
a:hover {
color: #FEE3AE;
}
a:active {
color: #CC6600;
}
.Style5 {font-size: small; font-family: Verdana, Arial, Helvetica, sans-serif;}
.Style6 {color: #CC0000}
.Style7 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #CC0000;
font-weight: bold;
}
.Style9 {font-family: Verdana, Arial, Helvetica, sans-serif}
.Style10 {
font-size: 11px;
font-weight: bold;
color: #666666;
}
.Style13 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #000000;
}
.Style15 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #CC0000; font-weight: bold; font-size: 14px; }
.Style18 {color: #CC6600}
.Style20 {color: #666666; font-size: 14px; }
.Style23 {font-size: 14px}
.Style24 {color: #666666}
.Style25 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #CC6600; font-weight: bold; font-size: 14px; }
-->
</style>
</head>
<body>
<table width="970" border="0" cellpadding="0" cellspacing="0" class="fond">
<!--DWLayoutTable-->
<tr>
<td width="13" height="13"></td>
<td width="15"></td>
<td width="387"></td>
<td width="7"></td>
<td width="110"></td>
<td width="7"></td>
<td width="402"></td>
<td width="29"></td>
</tr>
<tr>
<td height="78"> </td>
<td colspan="2" valign="top" class="bord"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="400" height="76">
<param name="movie" value="images/trans.swf" />
<param name="quality" value="high" />
<embed src="images/trans.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="76"></embed>
</object></td>
<td> </td>
<td valign="top"><a href="index.php"><img src="images/logo.jpg" width="110" height="76" border="0" /></a></td>
<td> </td>
<td valign="top" class="bord"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="400" height="76">
<param name="movie" value="images/guide.swf" />
<param name="quality" value="high" />
<embed src="images/guide.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="76"></embed>
</object></td>
<td> </td>
</tr>
<tr>
<td height="7"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="20"></td>
<td></td>
<td colspan="5" valign="top"><div align="center" class="Style5">
<div align="center"><span class="Style24">2 Pasteur (Angle 46 rue de Jouy) 78220 Viroflay. Tel.</span> <span class="Style18">01.30.24.06.07.</span> <span class="Style24">Fax. 01.30.24.06.33. Mail.</span> <span class="Style6"><a href="mailto:[email protected]">[email protected]</a></span> </div>
</div></td>
<td></td>
</tr>
<tr>
<td height="7"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="365"></td>
<td colspan="6" valign="top"><table width="735" border="1" align="center" cellpadding="4" bordercolor="#CC6600">
<?php do { ?>
<tr>
<td width="256" rowspan="3"><div align="center" class="Style9">
<div align="right" class="Style10"><?php echo $row_annonces['descriptif']; ?> </div>
</div> </td>
<td width="184"><div align="center" class="Style25"> <?php echo $row_annonces['Commune']; ?></div> </td>
<td width="255" rowspan="3" align="left" valign="bottom" class="Style13"><div align="left">
<p><span class="Style25"><?php echo $row_annonces['Type']; ?></span><br />
<span class="Style25"><?php echo $row_annonces['surfhab']; ?></span> <span class="Style25">m²</span><span class="Style7"><span class="Style20"> habitables</span></span> <br />
<span class="Style25"><?php echo $row_annonces['surfterr']; ?></span> <span class="Style25">m²</span><span class="Style20"> de terr. </span><br />
<span class="Style25"><?php echo $row_annonces['nbrepieces']; ?></span> <span class="Style20">pièce(s) </span><br />
<span class="Style25"><?php echo $row_annonces['nbrechbres']; ?></span><span class="Style7"> <span class="Style20">chambre(s)</span> </span><span class="Style24"><br />
<span class="Style23">Etat général : </span></span><span class="Style15 Style18"><?php echo $row_annonces['etatgeneral']; ?></span><br />
<span class="Style20">Chauffage :</span> <span class="Style25"><?php echo $row_annonces['chauffage']; ?></span><br />
<br />
</p>
</div> </td>
</tr>
<tr>
<td>
<div align="center"><a href="details.php?recordID=<?php echo $row_annonces['ID']; ?>"></a><a href="details.php?recordID=<?php echo $row_annonces['ID']; ?>"><img src="http://localhost/ag3c/images/<?php echo $row_annonces['Photo']; ?>" border="0" /></a></div> </td>
</tr>
<tr>
<td height="27"><div align="center" class="Style7"><span class="Style25"><?php echo $row_annonces['prix']; ?></span> <span class="Style25">€</span> </div> </td>
</tr>
<?php } while ($row_annonces = mysql_fetch_assoc($annonces)); ?>
</table>
<br />
<table border="0" width="50%" align="center">
<tr>
<td width="23%" height="15" align="center"><a href="<?php printf("%s?pageNum_annonces=%d%s", $currentPage, 0, $queryString_annonces); ?>"><img src="images/First.gif" width="18" height="13" border="0" /></a></td>
<td width="31%" align="center"><a href="<?php printf("%s?pageNum_annonces=%d%s", $currentPage, max(0, $pageNum_annonces - 1), $queryString_annonces); ?>"><img src="images/Previous.gif" width="14" height="13" border="0" /></a></td>
<td width="23%" align="center"><a href="<?php printf("%s?pageNum_annonces=%d%s", $currentPage, min($totalPages_annonces, $pageNum_annonces + 1), $queryString_annonces); ?>"><img src="images/Next.gif" width="14" height="13" border="0" /></a></td>
<td width="23%" align="center"><a href="<?php printf("%s?pageNum_annonces=%d%s", $currentPage, $totalPages_annonces, $queryString_annonces); ?>"><img src="images/Last.gif" width="18" height="13" border="0" /></a></td>
</tr>
</table> </td>
<td></td>
</tr>
<tr>
<td height="40"></td>
<td colspan="6" valign="top"><!--DWLayoutEmptyCell--> </td>
<td></td>
</tr>
<tr>
<td height="10"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($annonces);
?>
merci de votre aide