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
| <?php
$pass1=mysql_real_escape_string(htmlspecialchars($_POST['mot']));
$pass2=mysql_real_escape_string(htmlspecialchars($_POST['con']));
if($pass1 == $pass2){
header ('Content-type: text/html; charset=utf-8');
mysql_select_db($database_dbprotect, $dbprotect);
$verif_query=sprintf("UPDATE personne SET paswd='".$pass1."' WHERE id_personne='".$_SESSION['id_personne'] ."'");
$verif = mysql_query($verif_query, $dbprotect) or die(mysql_error());
if($verif){
echo'<script language="javascript"> alert("Mot de passe modifié"); </script>';
$verif_query=sprintf("SELECT type,libelle FROM `personne`,`entite` WHERE personne.entite=entite.id_entite AND personne.id_personne='".$_SESSION['id_personne'] ."'");
$verif = mysql_query($verif_query, $dbprotect) or die(mysql_error());
if($ligne = mysql_fetch_array($verif)){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Espace Gestion</title>
<style type="text/css">
<!--
.style1 {
color: #FF6600;
font-weight: bold;
}
-->
</style>
<link rel="stylesheet" type="text/css" href="form8.css" />
</head>
<body>
<table width="884" height="140" border="0" align="center">
<tr>
<th width="117" scope="col">Civilité : <br />
<span class="style1"><?php echo $_SESSION['civilite']; ?></span> </th>
<th width="104" scope="col">Nom : <br />
<strong class="style1"><?php echo $_SESSION['nom']; ?></strong> </th>
<th width="119" scope="col">Prénom : <br />
<strong class="style1"><?php echo $_SESSION['prenom']; ?></strong> </th>
<th width="117" scope="col">Qualité : <br />
<strong class="style1"><?php echo $_SESSION['qualite']; ?></strong> </th>
<th width="163" scope="col">Entitè: <br />
<strong class="style1"><?php echo $ligne["type"]." ".$ligne["libelle"]; ?></strong> </th>
<th width="99" scope="col">Identifiant : <br />
<strong class="style1"><?php echo $_SESSION['login']; ?></strong> </th>
<th width="135" scope="col">Mot de passe :<br />
<strong class="style1"><?php echo $_SESSION['paswd']; ?></strong> </th>
</tr>
</table>
</body>
</html>
<?php }
}}
else{
echo'<script language="javascript"> alert("Le mot de passe que vous avez entré est incorrect"); </script>';
echo ' <br/> <a href="javascript:history.back()">retour</a>';} ?> |
Partager