Bonjour à vous , voila je me retourne sur ce forum car j'ai quelque petits ennuis.
Donc voila , je n'arrive pas à recuperer la valeur d'une balise select.
Voici le bout de code :
select.Je remplie ma liste deroulante à partir de ma base de donnée, je pensais au depart pouvoir , une fois mon choix fait ds la liste déroulante , afficher une autre page avec simple clik sur la liste mais je n'ai pas trouver de solution donc je me suis dis qu'un bouton auquel je passerai les valeur du select marcherais , et effectivement je coince
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 <?php mysql_connect('localhost','root','online') or die("erreur de connexion au serveur"); mysql_select_db('contrat') or die("erreur de connexion a la base de donnees"); $sql="SELECT id, societe FROM fr_contrat ORDER BY societe ASC"; $req=mysql_query($sql) or die(mysql_error()); $req2=mysql_query($sql) or die(mysql_error()); echo" <html> <head> <title>Fiche Contrat</title> <link rel='stylesheet' type='text/css' href='style.css'> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> </head> <body> <form action='creationContratClient.php'> <table width='900' border='0' align='center' cellpadding='0' cellspacing='0'> <br> <!--Information générale --> <!--CHOIX CONTRAT --> <table width='60%' border='0' align='center'> <tr> <td width='100%' height='20' colspan='6' align='left' bgcolor='#800040' class='bordure5'><font color='white' type='bold'><b> CHOIX CONTRAT CLIENT</b></font></td> </tr> <tr> <td width='50%' bgcolor='#F5F5F5' class='bordure9'> <div align='right'> <select name='opt' style='border:0px solid; font-weight:normal;'> <option value=''></option> "; while($cat = mysql_fetch_array($req)) { echo '<option value="'.$cat['id'].'">' . $cat['societe'] . '</option>'; } $var = $_POST['opt']; echo " </select> <a href='./visualisationContratClient.php?param=$var' style='text-decoration:none; color:black; text-align:center; font-weight:bold; font-size:9.5px; background-color:#ffffff; padding:3px; border-width:1px; border-color:grey' target=_blank>Ok</a> </div> </td> </tr> </table> </body> </html>"; ?>
Avez vous un petite idée =) ....
Merci d'avance , Emmanuel.
Partager