Re: [PHP] Re: SESSION and include

2006-02-09 Thread Barry
Fredrik Tillman wrote: PROBLEM SOLVED! What I actually was including was a variable ($main) and since some my pages are called on from different pages in different folders what I actually did was seting $main to the full URL to the site (http://mysite.com/page.php) to avoid confusion. But whe

Re: [PHP] Re: SESSION and include

2006-02-09 Thread Jochem Maas
Fredrik Tillman wrote: PROBLEM SOLVED! yeah! :-) What I actually was including was a variable ($main) and since some my pages are called on from different pages in different folders what I actually did was seting $main to the full URL to the site (http://mysite.com/page.php) to avoid confus

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Eric Butera
On 2/8/06, Fredrik Tillman <[EMAIL PROTECTED]> wrote: > Ok here are some code: > /* Check User Script */ > session_start(); // Start Session > > include 'db.php'; > // Convert to simple variables > $username = $_POST['username']; > $password = $_POST['password']; > > if((!$username) || (!$passwo

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
PROBLEM SOLVED! What I actually was including was a variable ($main) and since some my pages are called on from different pages in different folders what I actually did was seting $main to the full URL to the site (http://mysite.com/page.php) to avoid confusion. But when calling on a URL I gu

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Jochem Maas
your problem is probably the fact that when you include page.php you are in effect calling session_start() twice - no idea what that does to your session but I wouldn't be suprised if that borked the _SESSION array. TIP: create a 'global include file' that contains all the code required by every

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Barry
Fredrik Tillman wrote: IN PAGE.PHP [More code here] Hit me if i am wrong, but doesn't it start a new session here? Would you mind removing the session_start() from that file and test it again? btw please try what i mentioned earlier. it's easier to locate the problem. Thanks. Barry --

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Fredrik Tillman
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 tried both single and double ones (',") Ok here are some code: IN LOGINSCRIPT: "; include 'index.htm'; exit(); } // Convert password to md5 hash $pass

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Jochem Maas
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"==$_SESSION[user_level]) { let this stuff happen } $_SESSION[user_level] is wrong unless 'user_level' is a defined constant

Re: [PHP] Re: SESSION and include

2006-02-08 Thread Barry
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"==$_SESSION[user_level]) { let this stuff happen } on my mainpage. on that same mainpage I use include ("page.php"); (I also

Re: [PHP] Re: SESSION and include

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

[PHP] Re: SESSION and include

2006-02-08 Thread Barry
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 o