<?PHP
$name1 = mysql_real_escape_string($_POST['nama']);
$password2 = mysql_real_escape_string($_POST['passbaru']);
$password2 = md5($password2);
include("../index.cma.login.db.php");
$query = "SELECT * FROM tab_login WHERE user_name = '$name1'";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
if ($name1 == $data['user_name'])
{
echo $password2;
$query = "UPDATE $mytable Set user_key = '$password2' where user_name = '$name1'";  
$result = mysql_query($query); 
print ('<table width="50%"  border="0" align="center" cellpadding="6" cellspacing="6">
  <tr>
    <td><a href="index.php?g=key&i=index" class="menu">BERHASIL DISIMPAN KLIK UNTUK KEMBALI</a></td>
  </tr>
</table>');
	exit;
}
else 
echo '<h1>UBAH PASSWORD GAGAL</h1>';

?>
