<?php

include  "../koneksi/koneksi.php";

$id = $_POST['id'];
$nama = $_POST['nama'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = base64_encode($_POST['password']);
$hp = $_POST['hp'];


if($_POST['password']==''){
$sql = "UPDATE user set nama='$nama', email='$email', username='$username', hp='$hp' WHERE id='$id'";

}else{
$sql = "UPDATE user set nama='$nama', email='$email', username='$username', password='$password', hp='$hp' WHERE id='$id'";
}


$proses = mysql_query($sql);
	if ($proses) {
		header('location:../profil.php?sukses='.base64_encode("Profil telah berhasil diupdate").'');
	} else { echo "Data belum dapat di simpan!!"; 
	}
?>

