示例#1
0
<?php

session_start();
include 'lib/dataprocess.php';
$dataprocess = new DataProcess();
$dataprocess->settings();
// Send a raw HTTP header
header('Content-Type: text/html; charset=UTF-8');
// Declare encoding META tag, it causes browser to load the UTF-8 charset
// before displaying the page.
echo '<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />';
$rows = $dataprocess->Login($_POST['user'], $_POST['pass']);
if (count($rows) > 0) {
    $_SESSION['fullname'] = $rows[0]['fullname'];
    $_SESSION['user_log'] = $rows[0]['username'];
    $_SESSION['pwd'] = $rows[0]['password'];
    $_SESSION['company'] = $rows[0]['company'];
    $_SESSION['company_lang'] = $rows[0]['company_lang'];
    $_SESSION['address'] = $rows[0]['address'];
    $_SESSION['address_lang'] = $rows[0]['address_lang'];
    $_SESSION['entity_id'] = $rows[0]['entity_id'];
    $_SESSION['authorize_signatory'] = $rows[0]['authorize_signatory'];
    $_SESSION['currency'] = $rows[0]['currency'];
    header('Location: index.php');
} else {
    header('Location:log.php?Error=Invalid username or password.');
}