Jump to content

include("includes/secure.php") issue


tobimichigan

Recommended Posts

Code Gents,

I'm having a bit of fuss here Gents,

<?php
if (!@session_register("login_name")){
header("location:Not_Logged")}
include ("includes/secure.php");
?>

 

Here's secure.php

<?php
session_start();
    if (isset($_GET['sessid'])) {
        $sessid = addslashes($_GET['sessid']);
    } else {
$sessid = "0";
    }

include("sql.php");
$sql="SELECT * from sessid WHERE sessid ='$sessid'";
$rsCat_query=mysql_query($sql);
$rsCat=mysql_fetch_array($rsCat_query);
$timeu_q=$rsCat["timeu"];
$cust_id=$rsCat["userid"];
$permission_q=$rsCat["permission"];
$ip_q=$rsCat["ip"];
$time_n=strtotime("now");
$time=(($time_n)-($timeu_q));
$ip_now = getenv("REMOTE_ADDR");
$sql3="UPDATE sessid SET timeu = '$time_n' where sessid = '$sessid'";

if ($sessid == "") {
include("header4.php");
header("location:NoSession_id.php");

die();
} elseif ($rsCat == 0) {
include("header5.php");
header("location:NoSession_id.php");
die();
} elseif ($time >= 900) {
include("header3.php");
header("location:Session_Expired.php");

die();
} //elseif ($ip_now != $ip_q) {
//include("header2.php");
//echo "<br><br><br><center>Your address doesn't match the one you logged in with.  <a href=\"login.php\" class=\"toplink\">Click Here</a> to login again.<br><br><br>";
//die();
//}
mysql_query($sql3);
?>                                             

 

The problem here is that instead of logging out idle users, it permanently shows"Session_Expired.php" without a chance of logging in the 1st place.

Any better ideas?

 

Link to comment
https://forums.phpfreaks.com/topic/207947-includeincludessecurephp-issue/
Share on other sites

It actually, gives access to the session start:

<?phpif (!@session_register("login_name"))
{header("location:Not_Logged")
}
///include ("includes/secure.php");?>

 

Once I comment or ignore the include like above...

But if I uncomment it it resumes to deny access to any page at all..."Session_Expired"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.