tobimichigan Posted July 16, 2010 Share Posted July 16, 2010 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 More sharing options...
gwolgamott Posted July 16, 2010 Share Posted July 16, 2010 Well Sir, what happens when you don't have the timer? Does your session still work as expected then? Link to comment https://forums.phpfreaks.com/topic/207947-includeincludessecurephp-issue/#findComment-1087112 Share on other sites More sharing options...
tobimichigan Posted July 16, 2010 Author Share Posted July 16, 2010 Yes it does.. Link to comment https://forums.phpfreaks.com/topic/207947-includeincludessecurephp-issue/#findComment-1087157 Share on other sites More sharing options...
tobimichigan Posted July 16, 2010 Author Share Posted July 16, 2010 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 https://forums.phpfreaks.com/topic/207947-includeincludessecurephp-issue/#findComment-1087163 Share on other sites More sharing options...
gwolgamott Posted July 16, 2010 Share Posted July 16, 2010 Ok I was just being sure that the issue was there and that the sessions was working up to that point. I came across this persons site, haven't tried it... but maybe it would help. http://www.weberdev.com/get_example-4267.html Link to comment https://forums.phpfreaks.com/topic/207947-includeincludessecurephp-issue/#findComment-1087174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.