Posted by garks on 08/13/07 02:56
I am the newbie in php
I have a problem about the session variable
When I create the session and session variable,
the variable is set in page 1, but in page 2 the variable is unset
and I don't know why.
I have searched a lot of tutorial, I followed all the steps but still
not work
Can anybody help me!!~
Thank you in advanced
I have created following code
page1.php:
<?php
session_start();
$_SESSION["test"] = "hello";
echo $_SESSION['test'];
header("Location: page2.php");
?>
page2.php
<?php
session_start();
if( !isset($_SESSION['test'])){
echo "The variable is not set
}
?>
The output:
page 1: hello
page 2: The variable is not set
Navigation:
[Reply to this message]
|