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
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"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.