mon code réalise une liste déroulante, avec des nom a l'intérieur et quand je clique sur un nom, que j'appuie sur le boutton ok; j'aimerai qui me renvoi le nom suivi du codeinfo.. si quelqu'un voudrait bien m'aider je lui en serait reconnaissantmerci développeur
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
25
26
27
28
29
30
31
32
33
34
35
36 <?php $config=array( 'Database'=>'udaf34', 'UID'=>'sa', 'PWD'=>'admin13@'); $idconnect=sqlsrv_connect('(local)',$config); if( $idconnect === false ) { echo "Could not connect.\n"; die( print_r( sqlsrv_errors(), true)); } $result=sqlsrv_query($idconnect,'SELECT codeinfo,nom FROM clientordon order by nom asc '); echo '<form name="selection" action="proto_php_sqlserver.php" method="post"> <select name="liste_deroulante">'; while($nini=sqlsrv_fetch_array($result)) { echo '<option value="' . $nini['nom'] . '">' . htmlentities($nini['nom']) . '</option>'; } echo '</select> <input type="submit" value="OK"> </form>'; while($nini=sqlsrv_fetch_array($result)) { echo '<option value='. $nini['nom']}-{$nini['codeinfo']}">" . htmlentities($nini['nom']) . '</option>'; } if (isset($_POST['liste_deroulante'])) { list($nom, $codeinfo) = explode('-', $_POST['liste_deroulante']) + array(""); } ?>![]()








Répondre avec citation


Partager