$email = anti_injection($_POST["email"]); $username = anti_injection($_POST["username"]); $password = md5(anti_injection($_POST["password"])); if ($nama == '' and $username == '') { ?> <script type="text/javascript"> alert('nama dan username tidak boleh kosong'); document.location.href='./index.php?mod=home&opt=profil&opts=list'; </script> <?php exit; } if ($email != '') { cek_email($email, "./index.php?mod=home&opt=profil&opts=list"); } if ($telepon != '') { cek_telepon($telepon, "./index.php?mod=home&opt=profil&opts=list"); } if (${$_POST}["password"] == "") { $d = mysql_query("update tbl_user set nama='{$nama}', alamat='{$alamat}', telepon='{$telepon}', email='{$email}', username='******' where username='******'"); } else { $d = mysql_query("update tbl_user set nama='{$nama}', alamat='{$alamat}', telepon='{$telepon}', email='{$email}', username='******', password='******' where username='******'"); } if ($d) { benar("./index.php?mod=home&opt=profil&opts=list"); $_SESSION["username"] == $username; exit; } else { salah("./index.php?mod=home&opt=profil&opts=list"); exit; }
<script type="text/javascript"> alert('isi dengan lengkap'); document.location.href='./index.php?mod=home&opt=member&opts=edit&id_user=<?php echo (int) $_GET["id_user"]; ?> '; </script> <?php } else { if ($email != '') { if (cek_email($email) == false) { pesan('email tidak valid', './index.php?mod=home&opt=member&opts=edit&id_user='******'') { if (cek_telepon($telepon) == false) { pesan('no telepon tidak valid', './index.php?mod=home&opt=member&opts=edit&id_user='******'{$nama}', alamat='{$alamat}', telepon='{$telepon}', email='{$email}', username='******', izin='{$izin}', level='{$level}' where id_user='******'"); } else { $d = mysql_query("update tbl_user set nama='{$nama}', alamat='{$alamat}', telepon='{$telepon}', email='{$email}', username='******', password='******', izin='{$izin}', level='{$level}' where id_user='******'"); } if ($d) { benar("./index.php?mod=home&opt=member&opts=list"); if ($_GET["username"] == $_SESSION["username"]) { $_SESSION["username"] == $username; } } else { salah("./index.php?mod=home&opt=member&opts=edit&id_user="******"id_user"]);