You are here: Problem with session variable « PHP Programming Language « IT news, forums, messages
Problem with session variable

Posted by stathisgotsis on 04/14/06 11:01

I am building a site and i want to password protect some pages. In
order to do this i use this variable: $_SESSION['validated'] and i set
it to true when a user has logged in. So in one file when a user has
logged in i have the following:
<?php
@session_start();
$_SESSION['validated']=true;

?>
I am trying to check if this variable is set to true in some other file
like this:
<?php
@session_start();
if ( isset($_SESSION['validated']) && $_SESSION['validated']==true )
{
/*Something*/
}
else
{
/*Do something else*/
}
?>
The problem is it seems i cannot access the $_SESSION['validated'] in
other files than the one i set it. What is the solution to this
problem? Please help

 

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

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