j'ai exactement le même problème que toi sur firefox, et pas sur internet explorer. Je vous met en premier le script du formulaire, et en second la page chargée de récupérer les données et modifier la bdd (le script n'est pas fini, il reste pas mal de chose à optimiser, notamment la confirmation du nouveau mot de passe, mais j'aimerais d'abord régler ce problème...) au cas où...
Merci de votre aide
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 <?php if(isset($_GET['clubs'])) { $clubs=$_GET['clubs']; echo $clubs; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>Le fabuleux site du BDA</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" media="screen" type="text/css" title="Design" href="codebis.css" /> </head> <body> <?php include("en_tete.php"); include("menugauche.php"); include("menudroite.php"); ?> <div id="chemin"><a href="accueil.php">Accueil</a><pre> -> </pre><a href="club.php">Clubs</a><pre> -> </pre><a href="<?php echo $clubs;?>/news_<?php echo $clubs;?>.php?clubs=<?php echo $clubs;?>">Club <?php echo $clubs;?></a><pre> -> </pre><a href="modifier_mdp.php?clubs=<?php echo $clubs;?>">Modification mot de passe</a></div> <div id="transparence"> <form method="post" action="modif_mdp.php?clubs=<?php echo $clubs;?>"> <input class="case" type="text" name="club" /><p>Club : </p> <input class="case" type="password" name="ancien_mdp" /><p>Ancien mot de passe : </p> <input class="case" type="password" name="nouveau_mdp" /><p>Nouveau mot de passe : </p> <input class="bouton" type="submit" value="Envoyer" /> </form> </div> </body> </html>
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113 <?php if(isset($_GET['clubs'])) { $clubs=$_GET['clubs']; } if(isset($_POST['club']) && isset($_POST['ancien_mdp']) && isset($_POST['nouveau_mdp'])) { $club=mysql_real_escape_string($_POST['club']); $ancien_mdp=mysql_real_escape_string($_POST['ancien_mdp']); $nouveau_mdp=mysql_real_escape_string($_POST['nouveau_mdp']); mysql_connect("localhost", "root", ""); mysql_select_db("test"); $retour = mysql_query("SELECT*FROM prez WHERE club='$club'") or die(mysql_error()); $donnees = mysql_fetch_array($retour); } if($donnees==NULL) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>Le fabuleux site du BDA</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" media="screen" type="text/css" title="Design" href="codebis.css" /> </head> <body> <?php include("en_tete.php"); include("menugauche.php"); include("menudroite.php"); ?> <div id="chemin"><a href="accueil.php">Accueil</a><pre> -> </pre><a href="club.php">Clubs</a><pre> -> </pre><a href="<?php echo $clubs;?>/news_<?php echo $clubs;?>.php?clubs=<?php echo $clubs;?>">Club <?php echo $clubs;?></a><pre> -> </pre><a href="modifier_mdp.php?clubs=<?php echo $clubs;?>">Modification mot de passe</a></div> <div id="transparence"> <p>Ce club n'existe pas</p> </div> <?php include("pied_de_page.php"); ?> </body> </html> <?php } elseif($ancien_mdp==$donnees['mdp']) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>Le fabuleux site du BDA</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" media="screen" type="text/css" title="Design" href="codebis.css" /> </head> <body> <?php include("en_tete.php"); include("menugauche.php"); include("menudroite.php"); ?> <div id="chemin"><a href="accueil.php">Accueil</a><pre> -> </pre><a href="club.php">Clubs</a><pre> -> </pre><a href="<?php echo $clubs;?>/news_<?php echo $clubs;?>.php?clubs=<?php echo $clubs;?>">Club <?php echo $clubs;?></a><pre> -> </pre><a href="modifier_mdp.php?clubs=<?php echo $clubs;?>">Modification mot de passe</a></div> <div id="transparence"> <?php mysql_query("UPDATE prez SET mdp='$nouveau_mdp' WHERE club='$club'"); ?> <p>La modification a bien été prise en compte</p> </div> <?php include("pied_de_page.php"); ?> </body> </html> <?php } elseif($ancien_mdp!=$donnees['mdp']) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>Le fabuleux site du BDA</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" media="screen" type="text/css" title="Design" href="codebis.css" /> </head> <body> <?php include("en_tete.php"); include("menugauche.php"); include("menudroite.php"); ?> <div id="chemin"><a href="accueil.php">Accueil</a><pre> -> </pre><a href="club.php">Clubs</a><pre> -> </pre><a href="<?php echo $clubs;?>/news_<?php echo $clubs;?>.php?clubs=<?php echo $clubs;?>">Club <?php echo $clubs;?></a><pre> -> </pre><a href="modifier_mdp.php?clubs=<?php echo $clubs;?>">Modification mot de passe</a></div> <div id="transparence"> <p>L'ancien mot de passe est incorrect. <a href="modifier_mdp.php">Cliquez ici</a> pour réessayer</p> </div> <?php include("pied_de_page.php"); ?> </body> </html> <?php } mysql_close(); ?>
Partager