Ce code PHP/mysql permet aux utilisateurs membres dans votre site (inscrits dans votre base de données ou vous meme) de changer le mot de passe, on peut appliquer ça pour le compte si on veut ou toute autre chose dont on veut laisser l'utilisateur de la changer s'il veut après avoir droit à y accéder.
La première des choses, je préfère dans ce cas qu'on crée une page html et autre php pour la bonne présentation et non pas une page html qui contient le formulaire et et son traitement (code php).
Vous pouvez changer la couleur des cellules, largeur du tableau écrires des commentaires avous voyez nécessaires....de lapage html. Créez cette page et nommez la "modifypswrd.htm" voici son code HTML:
<html>
<title>Modifier son mot de passe</title>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="form1" method="post" action="modifypswrd.php">
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"> </p>
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"> </p>
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"> </p>
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana" color="black"><span style="font-size:9pt;"><b>Changement
de mot de passe</b></span></font></p>
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"> </p>
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"> </p>
<p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"> </p>
<table width="337" align="center" cellspacing="0" bgcolor="silver" bordercolordark="white" bordercolorlight="white" cellpadding="0">
<tr>
<td width="156" bgcolor="silver" height="43"> <p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><font color="white"> </font><font face="Verdana" color="white"><b><span style="font-size:9pt;">Ancien
mot de passe</span></b></font></p>
</td>
<td width="181" height="43"> <p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana" color="navy"><b><span style="font-size:9pt;"><input type="password" name="ancienpass"></span></b></font></p>
</td>
</tr>
<tr>
<td width="156" bgcolor="silver"> <p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana" color="white"><b><span style="font-size:9pt;">Le
nouveau</span></b></font></p>
</td>
<td width="181"> <p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana" color="navy"><b><span style="font-size:9pt;"><input type="password" name="nouveaupass1"></span></b></font></p>
</td>
</tr>
<tr>
<td width="156" bgcolor="silver">
<p align="center"><font face="Verdana" color="white"><b><span style="font-size:9pt;">Confirmer
le</span></b></font></p>
</td>
<td width="181"> <p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><font face="Verdana" color="navy"><b><span style="font-size:9pt;"><input type="password" name="nouveaupass2"></span></b></font></p>
</td>
</tr>
<tr>
<td width="156" height="44">
<p> </p>
</td>
<td width="181" height="44"> <p align="center" style="line-height:100%; margin-top:0; margin-bottom:0;"><input type="submit" name="submit" value="Changement"></p>
</td>
</tr>
</table>
</form>
</body>
</html>
Remarque: n'oubliez pas de créer une table dans votre base (nommez la "admin" qui contient obligatoirement un champ nommé "password") biensur elle ne contient pas que ce champ (par éxemple aussi compte email....et les champ que vous voulez).