johnnei
New Member
- Messages
- 20
- Reaction score
- 0
- Points
- 0
Ey,
I use $_SESSION to save a login to acces some extra paged (duh -.-)...
But all variables are getting saved right but the already asigned one won't change.
I got this on top of my page:
This is on index.php and through index.php all other pages are including using include(x);.
When a log-ing succeeds it will generate this:
The output of the $_SESSION's are on that area: false, 5, Johnnei.
But above that the vars are also shown and there the id and acc are set fine but login is still on true.
Why does this occur?
Edit 1: Added index.php
Edit 2: Renewed source
Gr, Johnnei
I use $_SESSION to save a login to acces some extra paged (duh -.-)...
But all variables are getting saved right but the already asigned one won't change.
I got this on top of my page:
PHP:
<link href="data/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<?php
if(!isset($_SESSION))
{
session_start();
$_SESSION['login'] = "true";
echo 'NEW Session has been started<br>';
}
?>
@import url("data/style.css");
</style>
<script type="text/javascript" src="./data/lang.js"></script>
When a log-ing succeeds it will generate this:
PHP:
$_SESSION['login'] = "false";
$_SESSION['id'] = "".$myrow['id'];
$_SESSION['acc'] = "".$myrow['acc'];
echo 'You have been logged in, Login Requierd: '.$_SESSION['login'].'<br>';
echo 'Account ID has been set to: '.$_SESSION['id'].'<br>';
echo 'Account Name has been set to :'.$_SESSION['acc'].'<br>';
But above that the vars are also shown and there the id and acc are set fine but login is still on true.
Why does this occur?
Edit 1: Added index.php
Edit 2: Renewed source
PHP:
<?php session_start(); ?>
<link href="data/style.css" rel="stylesheet" type="text/css">
<!--<style type="text/css">
@import url("data/style.css");
</style> !-->
<script type="text/javascript" src="./data/lang.js"></script>
<center>
<?php
include("./data/common.php");
include("./module/user_data.php");
include("./data/header.php");
$op = "news";
//Get Page
if (isset($_GET['do']))
{
$op = "" . $_GET['do'];
}
else
{
$op = "news";
}
if($op == "reg")
{
include("module/register.php");
}
else if($op == "news")
{
include("module/news.php");
}
else if($op == "man")
{
include("module/manage.php");
}
else if($op == "ins")
{
include("module/install.php");
}
else if($op == "ser")
{
include("module/server.php");
}
else
{
echo 'The current page is not found in the server.';
}
?>
</center>
Gr, Johnnei
Last edited: