Advertisement
Guest User

Untitled

a guest
Aug 17th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php
  2. include "koneksi.php";
  3. if (isset($_POST['submit'])){
  4. if (isset($_POST['anggotaId'])){
  5. $anggotaId = mysqli_real_escape_string($mysqli, trim($_POST['anggotaId']));
  6. $anggotaNama = mysqli_real_escape_string($mysqli, trim($_POST['anggotaNama']));
  7. $username = mysqli_real_escape_string($mysqli, trim($_POST['username']));
  8. $password = mysqli_real_escape_string($mysqli, trim($_POST['password']));
  9. $alamat = mysqli_real_escape_string($mysqli, trim($_POST['alamat']));
  10.  
  11. $query = mysqli_query($mysqli, "UPDATE t_anggota SET anggotaNama='$anggotaNama',
  12. username='$username', password='$password', alamat='$alamat' WHERE anggotaId='$anggotaId'");
  13.  
  14. if($query){
  15. echo "<center><h4>Data berhasil !!</h4></center>";
  16. echo "<script>window.location='dashboard.php?action=Anggota';</script>";
  17. }else{
  18. echo "<center><h4>Data gagal di rubah!!</h4></center>";
  19. echo "<script>window.location='dashboard.php?action=Profil';</script>";
  20. }
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement