<?php
session_start();
@ob_start();
include "config/koneksi.php";



$module=$_GET['module'];
$act=$_GET['act'];
 
if ($module=='login' AND $act=='input'){
	

			function antiinjection($data){
			  $filter_sql = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))));
			  return $filter_sql;
			}

			$email = antiinjection($_POST['nama']);
			$pass     = antiinjection($_POST['passw']);
			
			$login=mysql_query("SELECT * FROM admins WHERE userid='$email' AND pass='$pass'");
			$ketemu=mysql_num_rows($login);
			$r=mysql_fetch_array($login);
			if ($ketemu > 0){
				$_SESSION['idm']     =  $r['pk'];
				$_SESSION['nama']     = $r['userid'];
				$_SESSION['akses']    = $r['akses'];
				$_SESSION['del']    = $r['del'];
				$custt = $r['userid'];
			
			}else{
				header('Location:failed.php');
				return false;
			}
	
		  header('Location:main.php');

}

?>
