Viera
Новичок
Ошибка авторизации
session_start();
if (!isset($_GET['access']))
{
if (isset($_POST['aut_butt']) and !empty($_POST['login']) and !empty($_POST['passw']))
{
$ora_result_usr_data=OCIParse($ora_connect,"SELECT * FROM webusers WHERE exist=1 and LOGINNAME='".$_POST['login']."' and PSW='".md5($_POST['passw'])."'");
OCIExecute($ora_result_usr_data);
OCIfetchstatement($ora_result_usr_data, $usr_data_arr);
if (sizeof($usr_data_arr['LOGINNAME'])!=0)
{
$_SESSION['loginname']=$usr_data_arr['LOGINNAME'][0];
$_SESSION['psw']=$usr_data_arr['PSW'][0];
$_SESSION['admin']=$usr_data_arr['ADMIN'][0];
$_SESSION['pcode']=$usr_data_arr['PCODE'][0];
$_SESSION['usr_id']=$usr_data_arr['CODE'][0];
}
else
{
$_SESSION['acc_denied_login'][@sizeof($_SESSION['acc_denied_login'])+1]=$_POST['login'];
$_SESSION['acc_denied_passw'][@sizeof($_SESSION['acc_denied_passw'])+1]=$_POST['passw'];
$alert='Доступ запрещен!';
}
}
if (isset($_SESSION['loginname']) and isset($_SESSION['psw']) and isset($_SESSION['admin']) and isset($_SESSION['pcode']) and isset($_SESSION['usr_id'])) {
if (isset($_SESSION['acc_denied_login'])) unset($_SESSION['acc_denied_login']);
if (isset($_SESSION['acc_denied_passw'])) unset($_SESSION['acc_denied_passw']);
//-add log--------------------------------------------------------------------
header('LOCATION: ./page1.php');
}
if (isset($_SESSION['acc_denied_login'])) {
if (sizeof($_SESSION['acc_denied_login'])==3)
{
header('LOCATION: '.$_SERVER['PHP_SELF'].'?access=denied');
Не пойму, где ошибка?
session_start();
if (!isset($_GET['access']))
{
if (isset($_POST['aut_butt']) and !empty($_POST['login']) and !empty($_POST['passw']))
{
$ora_result_usr_data=OCIParse($ora_connect,"SELECT * FROM webusers WHERE exist=1 and LOGINNAME='".$_POST['login']."' and PSW='".md5($_POST['passw'])."'");
OCIExecute($ora_result_usr_data);
OCIfetchstatement($ora_result_usr_data, $usr_data_arr);
if (sizeof($usr_data_arr['LOGINNAME'])!=0)
{
$_SESSION['loginname']=$usr_data_arr['LOGINNAME'][0];
$_SESSION['psw']=$usr_data_arr['PSW'][0];
$_SESSION['admin']=$usr_data_arr['ADMIN'][0];
$_SESSION['pcode']=$usr_data_arr['PCODE'][0];
$_SESSION['usr_id']=$usr_data_arr['CODE'][0];
}
else
{
$_SESSION['acc_denied_login'][@sizeof($_SESSION['acc_denied_login'])+1]=$_POST['login'];
$_SESSION['acc_denied_passw'][@sizeof($_SESSION['acc_denied_passw'])+1]=$_POST['passw'];
$alert='Доступ запрещен!';
}
}
if (isset($_SESSION['loginname']) and isset($_SESSION['psw']) and isset($_SESSION['admin']) and isset($_SESSION['pcode']) and isset($_SESSION['usr_id'])) {
if (isset($_SESSION['acc_denied_login'])) unset($_SESSION['acc_denied_login']);
if (isset($_SESSION['acc_denied_passw'])) unset($_SESSION['acc_denied_passw']);
//-add log--------------------------------------------------------------------
header('LOCATION: ./page1.php');
}
if (isset($_SESSION['acc_denied_login'])) {
if (sizeof($_SESSION['acc_denied_login'])==3)
{
header('LOCATION: '.$_SERVER['PHP_SELF'].'?access=denied');
Не пойму, где ошибка?