<?php
include "koneksi.php";
$user=$_POST["txtuser"];
$pass=$_POST["txtpass"];
$login = mysql_query("select * from admin where user='$user' and pass='$pass'");
$ketemu = mysql_num_rows($login);
$r = mysql_fetch_array($login);
// jika login berhasil diarahkan ke halaman administrator
if (($user==$r['user'])and($pass==$r['pass'])) {
session_start();
$_SESSION[user] = $r[user];
$_SESSION[pass] = $r[pass];
header("location:adminbarang.php");
}
else
{
echo "<center>User dan Password Salah!<br />";
echo "<a href='loginadmin.php'> Coba Lagi </a> </center>";
}
?>
include "koneksi.php";
$user=$_POST["txtuser"];
$pass=$_POST["txtpass"];
$login = mysql_query("select * from admin where user='$user' and pass='$pass'");
$ketemu = mysql_num_rows($login);
$r = mysql_fetch_array($login);
// jika login berhasil diarahkan ke halaman administrator
if (($user==$r['user'])and($pass==$r['pass'])) {
session_start();
$_SESSION[user] = $r[user];
$_SESSION[pass] = $r[pass];
header("location:adminbarang.php");
}
else
{
echo "<center>User dan Password Salah!<br />";
echo "<a href='loginadmin.php'> Coba Lagi </a> </center>";
}
?>
0 komentar:
Posting Komentar