コード例 #1
0
ファイル: login.php プロジェクト: VSG24/ccms
<?php

require_once '../c_config.php';
$session = new Sessions();
$i = null;
// just a helper for error checking
if (isset($_POST["submit"])) {
    $username = $_POST["username"];
    $password = $_POST["password"];
    if (verifyUser($username, $password)) {
        $id = Users::getIdByUsername($username);
        Cookies::setLoginCookies($id, 30);
        // remember for 30 dayz!
        $session->setSession($id, $username);
        $i = false;
    } else {
        $i = true;
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="js/jquery.min.js"></script>
    <link href="css/login.css" rel='stylesheet' type='text/css' />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
    <title>ccms Admin Login</title>
</head>