Annoying PHP error
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:
The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies. |
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:
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"); }
TheGodfather
Perception is reality
Trippy Wire Content Exchage Network
Trippy Wire is looking for partners in these niches niches: Humor, Movies, Gaming, Celebrities, Entertainment, Sports, Food & Drinks, Hot Women, Technology & Transportation.
Martin Keens Internet Marketing
Membership Guru Free Report
Instant List Building Kits
TheGodfather
Perception is reality
Trippy Wire Content Exchage Network
Trippy Wire is looking for partners in these niches niches: Humor, Movies, Gaming, Celebrities, Entertainment, Sports, Food & Drinks, Hot Women, Technology & Transportation.
TheGodfather
Perception is reality
TheGodfather
Perception is reality
TheGodfather
Perception is reality