TAHAPAN PENTING BAGI PROGRAMER :
1. Create koneksi.php
2.Cek.php
3.halaman index.php
Tiga tahapan diatas adalah bagaimana kita bisa terhubung kedatabase kita di XAMPP/ phpmyadmin anda masing-masing
1.koneksi.php
,
2.cek.php
alert('Maaf, userid atau password anda masih kosong',
document.location.href='javascript:history.back(0)')";
}
else
{
include("koneksi.php");
$sql="select * from tbadmin where (username = '".$_POST['username']."')
and (password = '$password')";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
if($row[username]==$username and $row[password]==$password)
{
session_start();
session_register("id_admin");
session_register("username");
session_register("last_login");
$id =$row[id];
$username =$row[username];
$Level =$row[Level];
{header("location:index.php");
}
{header("location:index.php");
}
}
else
{
echo"";
}}
?>
3.index.php
INDEX
Selamat mencoba dan semoga berhasil
Komentar
Posting Komentar