Пример #1
0
</head>

<body>
<?php 
include "../settings.php";
include "../language/{$cfg_language}";
include "../classes/db_functions.php";
include "../classes/security_functions.php";
include "../classes/form.php";
include "../classes/display.php";
$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, 'Sales Clerk', $lang);
$display = new display($dbf->conn, $cfg_theme, $cfg_currency_symbol, $lang);
if (!$sec->isLoggedIn()) {
    header("location: ../login.php");
    exit;
}
//set default values, these will change if $action==update.
$first_name_value = '';
$last_name_value = '';
$account_number_value = '';
$phone_number_value = '';
$email_value = '';
$street_address_value = '';
$comments_value = '';
$id = -1;
//decides if the form will be used to update or add a user.
if (isset($_GET['action'])) {
    $action = $_GET['action'];
Пример #2
0
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>
<TITLE>PHP Point of Sale Login</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

</HEAD>
<BODY BGCOLOR="#FFFFFF">
<form action="login.php" method="post" name="Login"><center>