You are here: mssing session variable in other page « PHP Programming Language « IT news, forums, messages
mssing session variable in other page

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация