rofl90 Posted March 16, 2008 Share Posted March 16, 2008 I don't get an error although in my error log it says undefined index: access thats what my hosting said was why I was having slow load times... yeh right.. Anyway thought i'd fix it, what I do is check if there is maintenance if there is, I check if $_SESSION['access'] != 'Granted' if this evaluates to true I redirect them to a maintenance page else I continue, do i need to define the session variable? Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/ Share on other sites More sharing options...
redarrow Posted March 16, 2008 Share Posted March 16, 2008 what you mean is $_SESSION['access'] defined? Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493463 Share on other sites More sharing options...
rofl90 Posted March 16, 2008 Author Share Posted March 16, 2008 Well if you're on maintenance and a user comes along not logged in, $_SESSION wouldn't be defined, no. Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493466 Share on other sites More sharing options...
BlueSkyIS Posted March 16, 2008 Share Posted March 16, 2008 turn down error reporting in php.ini or in script or you'll be seeing this 'notice' all over the place. Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493481 Share on other sites More sharing options...
rofl90 Posted March 16, 2008 Author Share Posted March 16, 2008 I know, so is this decreasing my load times? Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493484 Share on other sites More sharing options...
BlueSkyIS Posted March 16, 2008 Share Posted March 16, 2008 no, not at all. Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493489 Share on other sites More sharing options...
rofl90 Posted March 16, 2008 Author Share Posted March 16, 2008 So, my host company is bs'in me. Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493508 Share on other sites More sharing options...
BlueSkyIS Posted March 16, 2008 Share Posted March 16, 2008 if your site loads slowly and they claim it is because error reporting is turned too high, then yes. is there nothing in your code or database that could be the problem? Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493523 Share on other sites More sharing options...
sasa Posted March 16, 2008 Share Posted March 16, 2008 try if(!isset($_SESSION['access']) or $_SESSION['access'] != 'Granted') Quote Link to comment https://forums.phpfreaks.com/topic/96419-undefined-index/#findComment-493534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.