I have an annoying problem: I have created a website a few months back. After about a month or so, I've created the version 2.0 of the site, upgrading the site to the OOP model and adding some finesse.
Annoying PHP error
14
I have an annoying problem:
I have created a website a few months back. After about a month or so, I've created the version 2.0 of the site, upgrading the site to the OOP model and adding some finesse.
Now the problem seams simple, but it's damn frustrating.
I have a function that regulates access to certain parts of the site based on a session variable. The script works perfectly on the 1.0 version of the site, but gives me a:
type of error when i try to open the index page.
The problem is: I've literally copied the script to the 2.0 version, and I've organized the require_once files as they are in the 1.0 header file... and it's giving me trouble.
One thing I've noticed is: if I switch the position on where the script is included, then I usually get an error that at another script (not even related to index.php) has an error and that the script is calling an undefined function (but the function is defined).
Any insight to what may be the error?
This is the script that checks the session file to grant access:
I have created a website a few months back. After about a month or so, I've created the version 2.0 of the site, upgrading the site to the OOP model and adding some finesse.
Now the problem seams simple, but it's damn frustrating.
I have a function that regulates access to certain parts of the site based on a session variable. The script works perfectly on the 1.0 version of the site, but gives me a:
type of error when i try to open the index page.
The problem is: I've literally copied the script to the 2.0 version, and I've organized the require_once files as they are in the 1.0 header file... and it's giving me trouble.
One thing I've noticed is: if I switch the position on where the script is included, then I usually get an error that at another script (not even related to index.php) has an error and that the script is calling an undefined function (but the function is defined).
Any insight to what may be the error?
This is the script that checks the session file to grant access:
Code:
session_start();
ini_set('session.gc_maxlifetime', '86400');
ini_set('session.cookie_lifetime', '86400');
function logged_in()
{
return $_SESSION['logged_in'];
}
function grant_access()
{
if(!logged_in())
header("Location: index.php");
} - Backlinks Weekend
- TheGodfather
- [2] replies
- Backlinks Weekend
- KirkMcD
- deepakg
- bucksuper
- martinkeens
- TheGodfather
- bucksuper
- [1] reply
- TheGodfather
- TheGodfather
- TheGodfather
Next Topics on Trending Feed
-
14