<?php 
// mengaktifkan session php
session_start();
include "files.php";
// menangkap data yang dikirim dari form
$username = $_POST['username'];
$password = $_POST['psw'];
 
$cek = cek_userpass($username,$password);
 
if($cek > 0){
 $_SESSION['username'] = $username;
 $_SESSION['status'] = "login";
 header("location:action_page.php");
}else{
 header("location:../index.php");
}

?>