Пример #1
0
<?php

session_start();
include "settings.php";
include "language/{$cfg_language}";
include "classes/db_functions.php";
include "classes/security_functions.php";
//create two objects that are needed in this script.
$lang = new language();
$dbf = new db_functions($cfg_server, $cfg_username, $cfg_password, $cfg_database, $cfg_tableprefix, $cfg_theme, $lang);
$sec = new security_functions($dbf, 'Public', $lang);
if (isset($_POST['username']) and isset($_POST['password'])) {
    $username = $_POST['username'];
    $password = md5($_POST['password']);
    if ($sec->checkLogin($username, $password)) {
        $_SESSION['session_user_id'] = $dbf->getUserID($username, $password);
        header("location: index.php");
    } else {
        echo "<center><b>{$lang->usernameOrPasswordIncorrect}</b></center>";
    }
}
if ($sec->isLoggedIn()) {
    header("Location: index.php");
}
$dbf->closeDBlink();
?>
 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>