j'ai le code suivant :
Je veux recuperer la valeur de l'image comme suit : if($_POST['submit'] == 'Résultat')
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
74
75
76
77
78
79
80
81
82
83
84
85 <?php if($_POST['submit'] == 'Résultat') { $image = $_POST['one']; echo "$image"; } ?> <html> <head> <title>Menu fixe image... par Graphys</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"> <!-- // Alternative graphique à l'horrible menu déroulant que le CSS n'a jamais su embellir... //Une création de Graphys - http://graphys.online.fr // @+ function Graphys(nom) { var imgVide="Vide.gif"; var imgA="A.gif"; var imgB="B.gif"; var imgC="C.gif"; var imgD="D.gif"; var imgE="E.gif"; var imgF="F.gif"; var imgG="G.gif"; var imgH="H.gif"; var src=document.images[nom].src; src=src.substring(src.lastIndexOf("/")+1); if (src==imgVide) { document.images[nom].src=imgA; document.choice[nom].value="A"; }else if(src==imgA){ document.images[nom].src=imgB; document.choice[nom].value="B"; }else if(src==imgB){ document.images[nom].src=imgC; document.choice[nom].value="C"; }else if(src==imgC){ document.images[nom].src=imgD; document.choice[nom].value="D"; }else if(src==imgD){ document.images[nom].src=imgE; document.choice[nom].value="E"; }else if(src==imgE){ document.images[nom].src=imgF; document.choice[nom].value="F"; }else if(src==imgF){ document.images[nom].src=imgG; document.choice[nom].value="G"; }else if(src==imgG){ document.images[nom].src=imgH; document.choice[nom].value="H"; }else if(src==imgH){ document.images[nom].src=imgVide; document.choice[nom].value="Vide"; } } function Resultat() { var Z="Le Choix 1 est : "; Z+=document.choice.one.value; alert(Z); } //--> </script> </head> <body bgcolor="#FFFFFF" text="#000000"> <p><font face="Arial, Helvetica, sans-serif" size="3" color="#000066"><b><i>Remplace un menu déroulant par une image</i></b></font><br> <form name="choice" method="post" action=""> <font face="Arial, Helvetica, sans-serif" size="2" color="#003399"><b>Choix 1 :</b></font> <a href="javascript:Graphys('one')"><img id="one" src="Vide.gif" width="29" height="19" border=0 align="absmiddle"></a> <input type="hidden" name="one" value="Vide"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="#000066"> </font></b> </form> <input type="submit" value="Résultat" onClick="Resultat()" name="submit"> </body> </html>
{
$image = $_POST['one'];
echo "$image";}
mais je n'y arrive pas , je ne sais pas où le pb ??? klk pourra m'aider
Partager