<?php
$sessionbypass = 1;
include('sys/phpcore.inc');

$userid = $conn->real_escape_string($_POST['userid']);
$passwd = enc($_POST['passwd']);

$chk_sql_user = "SELECT * FROM dl_useraccount WHERE id = '$userid' AND npasswd = '$passwd'";
$chk_con_user = $conn->query($chk_sql_user);
$chk_skl_rs = $chk_con_user->fetch_assoc();
$id_user = $chk_skl_rs['id'];



if($id_user){

		//
		session_start();
        $_SESSION['userid'] = $id_user;

		$conn->query("UPDATE dl_useraccount SET login = CURRENT_TIMESTAMP() WHERE id = '$userid'");
		include('sys/session.inc');
		header('Location: home/db/index');
	}
else{

	header('Location: index?info=2');
	
	}
	

?>
