<?php
require 'spaceship/krypton.php';

$newpass = mysqli_real_escape_string($krypton, $_REQUEST['newpass']);
$ipnew = mysqli_real_escape_string($krypton, $_REQUEST['ipnew']);
$pass = md5($newpass);
$getid = mysqli_real_escape_string($krypton, $_GET['urut']);

if($newpass == '') {
$updatepass = "UPDATE superman SET ip_user ='$ipnew' WHERE id = '$getid'";
$qupdatepass = mysqli_query($krypton, $updatepass);
} else {
    $updatepass = "UPDATE superman SET password = '$pass' WHERE id = '$getid'";
$qupdatepass = mysqli_query($krypton, $updatepass);
}


if($qupdatepass) {
      echo '
    <script>
    alert("Profil Anggota Berhasil diubah!!");
    window.location.href = "tambahanggota.php";
    </script>
    ';

} else {
    echo '
    <script>
    alert("Profil Anggota GAGAL diubah!!");
    window.location.href = "tambahanggota.php";
    </script>
    ';
}

?>