Je m'explique:
J'ai un formulaire dans ma page vente.php qui appelle un cookie et qui me permet d'afficher 7, 20, 50, 100 ventes.
Voici l'essentiel de mon code...
Dans ma page vente.php:
$nb_results_p_page = isset( $_COOKIE[ 'rowsPerPage' ] ) ? $_COOKIE[ 'rowsPerPage' ] : 7; //Par defaut affichage de 7 ventes
Le formulaire qui appelle le fichier cookie_commmercial.phpCode : Tout sélectionner
<form action="cookie_commercial.php" method="POST">
<strong>Afficher</strong>
<input name="rowsPerPage" type="radio" value="7" checked="checked"> <strong>7</strong>
<input name="rowsPerPage" type="radio" value="20"> <strong>20</strong>
<input name="rowsPerPage" type="radio" value="50"> <strong>50</strong>
<input name="rowsPerPage" type="radio" value="100"> <strong>100</strong>
<input type="submit" value="Ventes" />
</form>$result = mysql_query("SELECT * FROM vente ORDER BY client LIMIT $start, $nb_results_p_page");
//le while
while ($vente=mysql_fetch_array($result))
{ Affichage du nom du commercial au survol de la souris et sur clic affichage de toutes les ventes du commercial
<?php
$com=$vente['idcommercial'];
$req_commer=mysql_query("select * from commercial where id_commercial='$com'");
$commer=mysql_fetch_array($req_commer);
$lien="index.php?liste=ventes&choix=commercial&com_choisi=".$commer['id_commercial'];
afficher_url($lien,"<img src=\"images/com.gif\" width=\"21\" height=\"21\" border=\"0\"alt=\" Voir les ventes de ".$commer['commercial']." \">");?>
Mon fichier cookie_commercial.php ou j'aimerais récupérer l'ID du commercial $commer['id_commercial'] dans la redirection.<?php
setcookie( 'rowsPerPage', $_POST[ 'rowsPerPage' ], time()+999999 );
?>
<html>
<head>
<title></title>
<meta http-equiv="REFRESH" content="0;url=index.php?liste=ventes&choix=commercial&com_choisi=<?php echo $commer['id_commercial'];?>">
</head>
<body>
</body>
</html>
Si je fais :Code : Tout sélectionner
<meta http-equiv="REFRESH" content="0;url=index.php?liste=ventes">J'ai essayé plein de trucs mais évidemment ça ne marche pas !
Un petit coup de main pour Noël ? merci.