Vivid Lust Posted July 18, 2008 Share Posted July 18, 2008 Hi! This doesn't seem to be working ??? <?php $x = $_POST['user']; $y = $_POST['pass']; $a = "admin"; $b = "123"; if ($x == $a && $y == $b){ $_SESSION['admin'] = $y; header("Location:*****/admin/"); } else{ header("Location:******/admin.php"); } ?> <?php session_start(); if(isset($_SESSION['admin'])) echo "<a href=logout.php>Log Out</a>"; else{ echo "<br>"; } ?> The problem is, is that when the script finds that the username and password combination is correct and directs to the admin/index.php it always shows the "echo "<br>"; so therfore it doesnt recognise the session!! Please help Thanks in advanced Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 18, 2008 Share Posted July 18, 2008 first thing you should do is make your viarable more descriptive Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 18, 2008 Share Posted July 18, 2008 session_register('admin'); $_SESSION['admin'] = $y; try that! tell me if it works Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted July 18, 2008 Author Share Posted July 18, 2008 It works now!, Thanks! Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted July 18, 2008 Share Posted July 18, 2008 No worries, just remember you need to register each season that was the function to register the session Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.