/home/techb158/immovalet.ca/Master
Edit: /home/techb158/immovalet.ca/Master/Update_Profile.php (3558B)
The email address you entered is not valid';
$texts="n'est pas valide";
header('Location: modifier_profil.php?error=Courriel que vous avez entré '.$texts.'!');
exit();
}
// header('Location: modifier_profil.php?error='.$Admin_ID);
// exit();
//$error_msg .= $FUserNames .' '. $Admin_ID .' '. $LUserNames;
// $error_msg .= $FUserNames .' '. $random_salt .' '. $LUserNames .' '. $Address .' '. $Phones .' '. $CompanyNames .' '. $Admin_ID .' '. $email .' '. $password ;
if (!$mysqli->query("UPDATE Master SET First_Name='$FirstName', Last_name='$LastName', Company_Name ='$Company', No_Of_Employee ='$No_Of_Employee', Email='$email', Phone ='$Contact_Phone', Address ='$Location_Address', City ='$Location_City', Location ='$Location', State ='$Location_State', ZipCode ='$Location_ZipCode' WHERE M_ID ='$Admin_ID'")) {
header('Location: modifier_profil.php?error=Votre mise à jour a échoué!');
exit();
}else{
header('Location: modifier_profil.php?error=Votre mise à jour est un succès!');
exit();
}
}else{
header('Location: modifier_profil.php?error=Toutes les informations sont obligatoires!');
exit();
}
}else if(isset($_POST["submitr"])) {
if($_POST['p'] != "")
{
$Admin_username= $_SESSION['username'];
$password = filter_input(INPUT_POST, 'p', FILTER_SANITIZE_STRING);
if (strlen($password) != 128) {
// The hashed pwd should be 128 characters long.
// If it's not, something really odd has happened
//$error_msg .= '
Invalid password configuration.
';
header('Location: modifier_profil.php?error=Configuration du mot de passe invalide.');
exit();
}
$random_salt = hash('sha512', uniqid(openssl_random_pseudo_bytes(16), TRUE));
// Create salted password
$password = hash('sha512', $password . $random_salt);
$Admin_ID= $_SESSION['user_id'];
if (!$mysqli->query("UPDATE Master SET Password ='$password', salt='$random_salt' WHERE M_ID ='$Admin_ID'")) {
header('Location: modifier_profil.php?error=Votre mise à jour a échoué!');
exit();
}else{ header('Location: modifier_profil.php?error=Votre mise à jour est un succès!');
exit();
}
}
}