This is the page page that sets the session. When I login and get to the next page which shown below this, it works, but then when I go to another page it shows the hard coded error message. (shown in the next PHP quote below). Why is this, it keeps doing it, has anyine any ideas, I have tried to change the security level on my mozilla fox, but it is already excepting all cookies.
Any ideas?
[code=php]
//Connect to the database and select used database
include(‘user.php’);
$connection = mysql_connect(“$host”,”$user”,”$password”)
or die(mysql_error());
mysql_select_db(“$txt_db_name”,$connection)
or die(mysql_error());
$submit = $_POST[‘submit’];
$PHP_SELF = $_SERVER[‘PHP_SELF’];
$kysely = mysql_query(“SELECT * FROM tplss_passwords WHERE PasswordID = ‘1’”,$connection)
or die(mysql_error());
$data = mysql_fetch_array($kysely);
$check = 0;
if($submit)
{
$user = $_POST[‘user’];
$password = $_POST[‘password’];
$season = $_POST[‘season’];
if($user == “$data[PasswordUser]” && md5($password) == “$data[PasswordPassword]”)
{
session_start();
//poistetaan sessio-keksi, jos jo olemassa
unset($_SESSION[‘sessio’]);
//Tehdään unique sessioid
srand((double)microtime()*1000000);
$sessio = md5(rand(0,9999));
$tmp = explode(“___”,$season);
$_SESSION[‘season_id’] = $tmp[0];
$_SESSION[‘season_name’] = $tmp[1];
$_SESSION[‘sessio’] = $sessio;
header(“Location:players.php?sessioid=$sessio”);
}
else
$check=1;
I have this on one of my pages after the login screen:
[code=php]
session_start();
$sessioid = $_REQUEST[‘sessioid’];
$sessio = $_SESSION[‘sessio’];
//Tarkistetaan sessio_id
if(!isset($sessioid) || $sessioid != “$sessio” || $sessioid == ”)
{
print(“Authorization failed.<br>
<a href=”index.php”>Restart, please</a>”);
}
else
{