voila j'ai un probleme je fais une liste deroulante afin de selectionner un client
voici le code :
depuis ce code je veux recuperer la valeur selon le client selectionné sur une autre page j'ai fait ca et ca ne m'affiche rien marlgre que j'ai selectionné un client :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <form method="POST" action="reach.php"> <select name="cli"> <?php $req2=mysql_query ("SELECT entreprise,contact from clients"); while ($res2=mysql_fetch_array($req2)) { ?> <option value="<?php $res2['entreprise'] ?>"> <?php echo $res2['entreprise'] ,"-", $res2['contact']; ?> </option> <?php } ?> </select> <input type="submit" value="rechercher"> </form>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 $cli=$_POST['cli']; $cnx=mysql_connect("localhost","root",""); mysql_select_db("tickets",$cnx); $req=mysql_query("SELECT * FROM clients where entreprise='$cli'"); $res=mysql_fetch_array($req) ?> <table width="100%" border="3px"> <tr> <td width="25%"> Nom Entreprise : </td> <td width="15%"> Contact : </td> <td width="20%"> Telephone : </td> <td width="20%"> Fax : </td> <td width="20%"> Mail : </td> </tr> <tr> <td width="25%"> <?php echo $res['entreprise']; ?> </td> <td width="15%"> <?php echo $res['contact']; ?> </td> <td width="20%"> <?php echo $res['telephone']; ?> </td> <td width="20%"> <?php echo $res['fax']; ?> </td> <td width="20%"> <?php echo $res['mail']; ?> </td> </tr> </table> </body>
Partager