Bonjour, je suis nouveau ici et avant tout je remercie ceux qui prennent sur leur temps pour nous répondre...
Voilà mon probléme :
ma page principale ventes.php
Ici j'ai un formulaire (boutons radio) qui me permet sur un clic d'afficher 7, 20, 50,100 ventes :
La requete
affichage des données
Affichage du nom et des ventes du commercial au survol de la souris et sur un clic affichage de toutes les ventes du commercial dans une nouvelle page commercial.php
Le fichier cookie.php
J'aimerais récupérer l'ID du commercial $commer['id_commercial'] dans la redirection de mon fichier cookie.php
J'ai essayé plein de trucs mais ça ne marche pas !
J'espére avoir été clair
merci
Modifié par Kimble (19 Dec 2005 - 10:58)
Voilà mon probléme :
ma page principale ventes.php
include("connexion.php");
//$choix défini si les ventes doivent être affichées par origine, commercial, ... ou tous.
$choix=(isset($_GET['choix'])) ? $_GET['choix'] : "";
//ces 7 variables permettent de savoir quelles ventes afficher en fonction de l'origine, le commercial,la catégorie, la commune choisi
$formulaire_r=(isset($_POST['formulaire_r'])) ? $_POST['formulaire_r'] : "";
$recherche=(isset($_GET['recherche'])) ? $_GET['recherche'] : "";
$ori_choisi=(isset($_GET['ori_choisi'])) ? $_GET['ori_choisi'] : "";
$com_choisi=(isset($_GET['com_choisi'])) ? $_GET['com_choisi'] : "";
$cat_choisi=(isset($_GET['cat_choisi'])) ? $_GET['cat_choisi'] : "";
$ville_choisi=(isset($_GET['ville_choisi'])) ? $_GET['ville_choisi'] : "";
$cli=(isset($_GET['cli'])) ? $_GET['cli'] : "";
$query = mysql_query( "SELECT * FROM vente" ); //query the table
$numrows = mysql_num_rows( $query ); //how many rows will be fetched?
$nb_results_p_page = isset( $_COOKIE[ 'rowsPerPage' ] ) ? $_COOKIE[ 'rowsPerPage' ] : 7; //Par defaut affichage de 7 ventes
Ici j'ai un formulaire (boutons radio) qui me permet sur un clic d'afficher 7, 20, 50,100 ventes :
<form action="cookie.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>
La requete
<?php
$result = mysql_query("SELECT * FROM vente ORDER BY client LIMIT $start, $nb_results_p_page");
//l'en-tête du tableau en html
//blabla...
//la boucle
while ($vente=mysql_fetch_array($result))
{
affichage des données
Affichage du nom et des ventes du commercial au survol de la souris et sur un clic affichage de toutes les ventes du commercial dans une nouvelle page commercial.php
echo '<td bgcolor='.$bgcolor.'>';?><span class="Style8">
<?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=commercial&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']." \">");?>
Le fichier cookie.php
<?php
setcookie( 'rowsPerPage', $_POST[ 'rowsPerPage' ], time()+999999 );
?>
<html>
<head>
<title></title>
<meta http-equiv="REFRESH" content="0;url=index.php?liste=commercial&choix=commercial&com_choisi=">
</head>
<body>
</body>
</html>
J'aimerais récupérer l'ID du commercial $commer['id_commercial'] dans la redirection de mon fichier cookie.php
<meta http-equiv="REFRESH" content="0;url=index.php?liste=commercial&choix=commercial&com_choisi= [b][#red]ICI[/#][/b]
J'ai essayé plein de trucs mais ça ne marche pas !
J'espére avoir été clair

Modifié par Kimble (19 Dec 2005 - 10:58)