nm! I got it working 😃, heres the small differences I made...
login2.php:
$_SESSION['do_email']=$do_email;
$_SESSION['do_pass']=$do_pass;
$_SESSION['user_logged_in']=1;
session_write_close(); // wasnt there b4, thats y my session kept ending
header("Location: next.php"); // used instead of "login ok" message, I also changed this from: header("Refresh: 0; url=login1.php");
next.php:
session_start();
if ($_SESSION['user_logged_in']!=1) // changed from: if (!isset ($_SESSION['user_logged_in']))
print "Please login <a href=\"login.php?s=1\">here</a>";
else
{
print "admin panel :-D";
}
So it works well now 🙂 One other thing that caused it 2 not work was the way PHP is configured on my machine...I uploaded my code to my web-host with my changes and it all works 😃
So thanx alot for your help guys, you saved me alot of time!
Oh btw, wot wud the code be for say..logout.php? Sumthin using session_destroy();? Thanx once again 🙂