<?php
session_start();
include ‘../conn/connection.php’;
if (!empty($_POST['txtUsername']) && !empty($_POST['txtPassword'])) {
$username = $_POST['txtUsername'];
$karakter = “D3PxK4IzP3Bz”;
$enkripsi = md5($karakter . $_POST['txtPassword']);
$qUser = “select nip,nama,username,password,level from tbl_pengguna where
username=’$username’ and password=’$enkripsi’”;
$rsUser = mysql_query($qUser);
$rUser = mysql_fetch_array($rsUser);
if ($rUser[2] == $username && $rUser[3] == $enkripsi) {
$_SESSION['id_acount'] = $rUser[0];
$_SESSION['name_acount'] = $rUser[1];
$_SESSION['username_acount'] = $rUser[2];
$_SESSION['password_acount'] = $rUser[3];
$_SESSION['level_acount'] = $rUser[4];
?>