<LINK href="images/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
    function refreshAndClose() {
        window.opener.location.reload(true);
        window.close();
    }
</script>
<body onbeforeunload="refreshAndClose();">
<?PHP
$name1 = $_POST['nama'];
$password2 = $_POST['passbaru'];
$password3 = md5($password2);
include("../index.cma.login.db.php");
$query = "SELECT * FROM $mytable WHERE user_name = '$name1'";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
if ($name1 == $data['user_name']){
$query = "UPDATE $mytable Set user_key = '$password3' where user_name = '$name1'";  
$result = mysql_query($query); 
print ('<table width="50%"  border="0" align="center" cellpadding="6" cellspacing="6">
  <tr>
    <td>BERHASIL DI UBAH. SILAHKAN TUTUP HALAMAN INI</td>
  </tr>
</table>');
	exit;
}
else 
echo '<h1>UBAH PASSWORD GAGAL</h1>';

?>
