Example #1
0
<?php

include 'core/init.php';
if (isset($_POST['do_login'])) {
    $username = $_POST['username'];
    $password = md5($_POST['password']);
    $user = new User();
    if ($user->do_login($username, $password)) {
        redirect('index.php', 'Youve logged in', 'success');
    } else {
        redirect('index.php', 'You did not log in', 'error');
    }
} else {
    redirect('index.php');
}