Invité
Invité n'ayant pas de compte PHPfrance
09 avr. 2006, 19:44
les paramettre passe par url ex:
http://www.monsite.com/fiche.php?page=c ... tiondivers
je les met dans ma session:
<?php
session_start();
$_SESSION['id_machine'] = $_POST['id_machine'];
if (isset($_GET['marque']) && isset($_GET['util'])) {
$_SESSION['marque'] = $_GET['marque'] ;
$_SESSION['util'] = $_GET['util'] ;
?>
....
....
<?php
$nombre = 8;
if (!$limite) $limite = 0;
$path_parts = pathinfo($_SERVER['PHP_SELF']);
$page2 = $path_parts["basename"];
$page = $page2.'?page=comp' ;
echo $page ;
...
...
$select = 'SELECT count(id_article) FROM '.$table ;
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
$row = mysql_fetch_row($result);
$total = $row[0];
$verifLimite= verifLimite($limite,$total,$nombre);
if(!$verifLimite) {
$limite = 0;
}
$select = 'select * FROM '.$table. ' LIMIT '.$limite.','.$nombre ;
$result = mysql_query($select,$link) or die ('Erreur : '.mysql_error() );
?>
dans mon exemple j'ai même enlever de ma requete le WHERE je prend donc tous ce qu'il y a dans ma table.
<form id="form1" name="form1" method="post" action="fiche.php?page=resultat">
<?php
while($row = mysql_fetch_array($result)) {
$tabTitre = array('Marque','Model');
?>
//la suite du code:
<div>
<ul>
<li class="title"><a href="<? echo '../images/big/'.$row['photo']; ?> " class="tn" title="titre"><img src="<? echo '../images/'.$row['photo']; ?> " alt="" /></a></li>
<li class="title"><?php echo $tabTitre[0].': <span>'; echo($row['marque']); ?></span></li>
<li class="title"><?php echo $tabTitre[1].': <span>'; echo($row['model']); ?></span></li>
<li class="title"><span><a href="<?php echo 'fiche.php?page='.$row['fiche']; ?> ">Voir Fiche</a></span></li>
<li class="title">Selection: <label><input type="checkbox" name="id_article[]" value="<?php echo($row['id_article']); ?>" /></label></li>
</ul>
</div>