Просмотр файла inc/inc.php

Размер файла: 1.91Kb
<?php
Error_Reporting(E_ALL &~E_NOTICE);
Error_Reporting (ERROR | WARNING);
// extract($HTTP_GET_VARS);
// extract($HTTP_POST_VARS);
// extract($HTTP_COOKIE_VARS);
// extract($HTTP_SERVER_VARS);
// extract($HTTP_SESSION_VARS);
// ini_set('error_reporting', 'E_ALL & ~E_NOTICE & ~E_WARNING');
ini_set('url_rewriter.tags', '');
ini_set("session.use_coocies", true);
// ini_set("session.use_trans_sid", true);
session_name("SES");
session_start();

extract($_GET);
extract($_POST);
extract($_COOKIE);
extract($_SERVER);
extract($_SESSION);
$login2 = htmlspecialchars(stripslashes($_SESSION['login']));
// echo $_COOKIE['login'];
// echo $_COOKIE['password'];
$zapros = 'SELECT * FROM ' . $pref . 'useres where login=\'' . $login2 . '\';';
$logins = mysql_fetch_assoc(mysql_query($zapros));
if ((isset($_SESSION['login'])) && ($_SESSION['login'] != '') && ($_SESSION['login'] == $logins['login']) && (isset($_SESSION['pass'])) && ($_SESSION['pass'] != '') && ($_SESSION['pass'] == $logins['pwd'])) {
    $login = $logins['login'];
    $pass = $logins['pwd'];
    $idid = $logins['id'];
} else {
    $cook = htmlspecialchars(stripslashes($_COOKIE['login']));

    $zapros = 'SELECT * FROM ' . $pref . 'useres where login=\'' . $cook . '\';';
    $logins = mysql_fetch_assoc(mysql_query($zapros));
    if ((isset($_COOKIE['login'])) && ($_COOKIE['login'] != '') && ($_COOKIE['login'] == $logins['login']) && (isset($_COOKIE['password'])) && ($_COOKIE['password'] != '') && ($_COOKIE['password'] == $logins['pwd'])) {
        $login = $logins['login'];
        $pass = $logins['pwd'];
        $idid = $logins['id'];
        $_SESSION['login'] = $login;
        $_SESSION['pass'] = $pass;
        $_SESSION['idid'] = $idid;
    } else {
        unset ($_SESSION['login']);
        unset ($_SESSION['pass']);
        unset ($_SESSION['idid']);
        $login = '';
        $pass = '';
        $idid = '';
    } 
} 

?>