<?php
session_start();
require_once("../koneksi/koneksi.php");
$username = $_POST['username'];
$password = $_POST['password'];
$cekuser = mysql_query("SELECT * FROM admin WHERE username = '$username'");
$jumlah = mysql_num_rows($cekuser);
$hasil = mysql_fetch_array($cekuser);
if($jumlah == 0) {
echo "User ID Belum Terdaftar!<br/>";
echo "<a href=\"admin.php\">« Back</a>";
} else {
if($password <> $hasil['password']) {
echo "Password Salah!<br/>";
echo "<a href=\"admin.php\">« Back</a>";
} else {
$_SESSION['username'] = "$username";
header('location:admin.php');
}
}
?>
<?php
session_start();
if(isset($_SESSION['username'])) {
header('location:admin.php'); }
require_once("../koneksi/koneksi.php");
?>
<?php
session_start();
if(!isset($_SESSION['username'])) {
header('location:index.php'); }
else { $username = $_SESSION['username']; }
require_once("../koneksi/koneksi.php");
$query = mysql_query("SELECT * FROM admin WHERE username = '$username'");
$hasil = mysql_fetch_array($query);
?>
session_start();
require_once("../koneksi/koneksi.php");
$username = $_POST['username'];
$password = $_POST['password'];
$cekuser = mysql_query("SELECT * FROM admin WHERE username = '$username'");
$jumlah = mysql_num_rows($cekuser);
$hasil = mysql_fetch_array($cekuser);
if($jumlah == 0) {
echo "User ID Belum Terdaftar!<br/>";
echo "<a href=\"admin.php\">« Back</a>";
} else {
if($password <> $hasil['password']) {
echo "Password Salah!<br/>";
echo "<a href=\"admin.php\">« Back</a>";
} else {
$_SESSION['username'] = "$username";
header('location:admin.php');
}
}
?>
<?php
session_start();
if(isset($_SESSION['username'])) {
header('location:admin.php'); }
require_once("../koneksi/koneksi.php");
?>
<?php
session_start();
if(!isset($_SESSION['username'])) {
header('location:index.php'); }
else { $username = $_SESSION['username']; }
require_once("../koneksi/koneksi.php");
$query = mysql_query("SELECT * FROM admin WHERE username = '$username'");
$hasil = mysql_fetch_array($query);
?>
0 komentar:
Posting Komentar