Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['Update'])) //OM UPDATE KNAPPEN TRYCKS PÅ SÅ...
- {
- $PW = $_POST['Password'];
- if(password_verify($PW, $row['Password'])) //KOLLAR OM LÖSENORDET MATCHAR MED DET I DATABASEN
- {
- if(isset($_POST['NewPassword'])) //KOLLAR OM NYA-LÖSENORDS-FÄLTET ÄR I FYLLT -- HOPPAR ÖVER DENNA
- {
- if($_POST["NewPassword"] == $_POST["RepPassword"])
- {
- $UpdatePW = $_POST['NewPassword'];
- $StorePassword = password_hash($UpdatePW, PASSWORD_BCRYPT, array('cost' => 10));
- $sql = $con->query("UPDATE user SET Password = '{$StorePassword}' where UserID=$User");
- echo '<script>';
- echo 'Alert("Ditt lösenord är uppdaterat!");';
- echo '</script>';
- header('Location: logout.php');
- }
- else
- {
- echo '<script>';
- echo 'alert("Lösenordern matchar inte!");';
- echo '</script>';
- }
- }
- /*if(isset($_POST['Skola']))
- {
- $UpdateSchool = $_POST['Skola'];
- $sql = $con->query("UPDATE user SET School = '{$UpdateSchool}' where UserID=$User");
- header('Location: account.php');
- }*/
- }
- else
- {
- echo '<script>';
- echo 'alert("Du har anget fel lösenord!");';
- echo '</script>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment