include "koneksi.php";
$nama=$_POST["nama"];
$password=$_POST["password"];$perintah="select * from administrator where nama='$nama' and password='$password'";
$hasil=mysql_query($perintah);
$row=mysql_fetch_array($hasil);
if ($row[nama]=$nama and $row[password]=$password)
{ session_start();
session_register("namauser");
session_register("passuser");
$namauser=$row[nama];
$passuser=$row[password];
if ($row[level]=='1')
{ header("Location:cms.php"); }
else
{ header("Location:indexuser.php"); }
}
else {
echo("Login Gagal, Karena Nama & Password tidak benar atau
");
echo("Anda Belum Terdaftar Sebagai Anggota
");
echo("Login Ulang
");
echo("DafTar");
}
?>
Wednesday, 4 February 2009
Login Code PHP
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment