Re: SESSIONS and include()

From: Date: Thu, 09 Feb 2006 04:41:15 +0000
Subject: Re: SESSIONS and include()
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-26686@lists.php.net to get a copy of this message
Read the user post (currently 2nd) from greatmagicalhat [at] gmail [dot] com at the link below. I've never tried including a php file myself so cannot verify their information, but it makes sense. When I use includes, I use a specific file extension and store the files in a protected directory (so they are not just able to be viewed by browsing directly to the file) and it works fine. If you do it with a different file extension, make sure you configure your web server to make PHP process pages with that extension. Cheers. http://ca3.php.net/manual/en/function.include.php Armando Fredrik Tillman wrote:
Hi PROBLEM: I want to let certain users use certain funcions on my page. To manage that I start a session and define $_SESSION[user_level] to a value from a mySQL table. So far so good. Users with $_SESSION[user_level]=="1" can access things on the .php page they are on. I made a simple if-statement to handle that. Now the problem is that i want to use include("page.php") and let the users with user_level=1 access special things on that included page. The if statements that let them change things work if I access the page directly from my browser but not when it is included in that main page. Whats am I missing?


« previous php.windows (#26686) next »