daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Jul 20th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     <?php
  2.  
  3.     session_start();
  4.     if(isset($_SESSION['s_logged_n']) && $_SESSION['s_logged_n'] == 'true'){
  5.  
  6.     $username = $_SESSION['s_username'];
  7.  
  8.     if(isset($_POST['update'])){
  9.  
  10.     $id = $_GET['id'];
  11.  
  12.     include "config.php";
  13.  
  14.     $password=$_GET["password"];
  15.     $password_confirm=$_GET["password_confirm"]
  16.  
  17.     $password = addslashes(trim($password));
  18.     $password_confirm = addslashes(trim($password_confirm));
  19.  
  20.     if ($password == $password_confirm){
  21.  
  22.     $password = md5($password);
  23.  
  24.     $query = "UPDATE users SET password = '$password' WHERE user_id = '$id' AND username = '$username' LIMIT 1";
  25.     $result = mysql_query($query);
  26.  
  27.     if($result){
  28.     echo "You have successfully edited your password";
  29.     } else {
  30.  
  31.     echo "There was an error editing your password";
  32.     }
  33.     } else {
  34.  
  35.     echo "Your passwords don't match each other";
  36.     }
  37.     }
  38.     } else {
  39.     echo "You must be logged in to access this area";
  40.     }
  41.     ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top