[PHP] SESSION and include

2006-02-08 Thread Fredrik Tillman
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

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
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

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
['user_level'])) { echo (Session is empty);} ? [More code here] Can you see anything I am doing wrong? /F Jochem Maas wrote: Fredrik Tillman wrote: 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

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
require_once 'global.inc.php'; // bla bla bla - do stuff GLOBAL.PHP ?php session_start(); // do more repetitive 'init' stuff Fredrik Tillman wrote: ok.. I was a little too fast again when explaining my problem.. Gonna put some code up for you to see... First of all I DO use quotes. I