Okay, I’ve had major problems with sessions; I can’t seem to get them to work.
Basicly I have a Login script which checks a SQL database.
But I want to protect multiple pages, I tried cookies and gave up. So then I tried sessions.
Tell me if this is right
session_start( );
session_register("$username","$password");
$session=session_id( );
echo ("<script language=\"JavaScript\"><!--
setTimeout(\"top.location.href = 'index2.php?$session'\",1000);
//--></script>");
It should get $username and $password from the login form.
I have two pages, index.php and index2.php
Index.php just checks the login and passes the sessions on, then if its right, goto index2.php, which has the if level of access is 1 then display this, blarh blarh…
Thanks in advance