Re: Re: SESSION and include

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

/Fredrik

use require()

www.php.net/require

Greets
    Barry


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux