Jump to content

[SOLVED] Sessions Help


Vivid Lust

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/115392-solved-sessions-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.