Re: Re: SESSION and include
| From: | Fredrik Tillman | Date: | Wed, 08 Feb 2006 15:36:27 +0000 |
| Subject: | Re: Re: SESSION and include | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230100@lists.php.net to get a copy of this message | ||
ok.. Let me explain the problem better.
'user_level' is set by a login script. It seems to be working fine since I can make things like:
if ("1"==$_SESSION[user_level]) { let this stuff happen }
on my mainpage.
on that same mainpage I use
include ("page.php");
(I also tried require...)
If I access page.php directly (by writing the URL in my browser) things like
if ("1"==$_SESSION[user_level]) { let this stuff happen }
will work just fine, but when page.php is included in mainpage the $_SESSION[user_level] is empty for that included part...
/Fredrik
Barry wrote:
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? /Fredrikuse require() www.php.net/require GreetsBarry