Advertisement
Guest User

Untitled

a guest
Aug 17th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2. include "../../library/environment.php";
  3. include "../../library/database.php";
  4.  
  5. $id = $_POST['id_user'];
  6. $username = $_POST['username'];
  7. $password = $_POST['password'];
  8. $nama = $_POST['nama'];
  9. $email = $_POST['email'];
  10.  
  11. $query = "UPDATE tbl_user SET username = '$username', pass = MD5('$password'), nama = '$nama', email = '$email' WHERE id_user = '$id'";
  12.  
  13. if ($connect->query($query) === TRUE) {
  14.  
  15. session_destroy();
  16. session_start();
  17.  
  18. $_SESSION['id_user'] = $id ;
  19. $_SESSION['username'] = $username ;
  20. $_SESSION['password'] = md5($password) ;
  21. $_SESSION['nama'] = $nama ;
  22. $_SESSION['email'] = $email ;
  23.  
  24. header("location:../media.php?ref=profile");
  25.  
  26. } else {
  27.  
  28. echo "gagal update";
  29.  
  30. }
  31.  
  32.  
  33.  
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement