Sessions directory sepcific?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Sessions directory sepcific?

Post by Elmseeker »

Are sessions in PHP directory specific? I am trying to set it up so that if someone tries to go my sites images sub directory they will be redirected to the main page of the site unless they are logged in and have a certain user level...I am logged in with that user level and I still keep getting redirected...I tried using some echo's to find out the session info but it appears that there is none, though when I go back to the main page of the site it says Welcome Back Elmseeker and shows my session info...here is the code of the page in the images directory:

Code: Select all

<?
if ( !$login ) {
header("Location: http://kidstop.farviolet.com/");
} else if ( $_SESSION["login"]["u_level"] == 11 ) {
opendir("/home/tiffani/public_html/kidstop/images");
}
?>
Thanks guys and gals!
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

hey, remember to put session_start() at the begining of every file using sessions! :)
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Post by Elmseeker »

DOH!!!!!


I am SUCH AN IDIOT SOMETIMES! Why is it always the easy little majorly glaring errors I miss? the hard to spot where they are bugs...NO PROBLEM, find 'em in short order usually...but not the easy ones...NNNNOOOOO those have to torture me for days at a time!


Thanks a bunch!
Post Reply