Hi ,
I am back with another small problem:
I want to create a session in which i want to declare a session variable. I want to use the value of that session variable on the next two pages. This is the code that i have.
1st page:[CODE=php]<?PHP
session_start() ;
session_registe r ("demo");
if($_SERVER['HTTP_REFERER'] == "http://localhost/FAO_test/firms_WEB/Untitled-6.php")
{
$test=1;
$_SESSION["demo"]= $test;
}
?>
[/CODE]2nd page
[CODE=php]<?PHP
session_start() ;
if ($_SESSION['demo']== 1)
include ("Untitled-7.php");
?>
[/CODE]
3rd page
[CODE=php]<?PHP
session_start() ;
if ($_SESSION['demo']== 1)
include ("Untitled-7.php");
?>[/CODE]But the problem is that the value of demo is not registering and i dont think the if statement in the 2nd and 3rd page is working. It displays the UNtitled-7.php even if demos value is not 1.
Please tell me what i am doing wrong??
I am back with another small problem:
I want to create a session in which i want to declare a session variable. I want to use the value of that session variable on the next two pages. This is the code that i have.
1st page:[CODE=php]<?PHP
session_start() ;
session_registe r ("demo");
if($_SERVER['HTTP_REFERER'] == "http://localhost/FAO_test/firms_WEB/Untitled-6.php")
{
$test=1;
$_SESSION["demo"]= $test;
}
?>
[/CODE]2nd page
[CODE=php]<?PHP
session_start() ;
if ($_SESSION['demo']== 1)
include ("Untitled-7.php");
?>
[/CODE]
3rd page
[CODE=php]<?PHP
session_start() ;
if ($_SESSION['demo']== 1)
include ("Untitled-7.php");
?>[/CODE]But the problem is that the value of demo is not registering and i dont think the if statement in the 2nd and 3rd page is working. It displays the UNtitled-7.php even if demos value is not 1.
Please tell me what i am doing wrong??
Comment