You are here: trying to access variable on different pages with reigster_globals = Off « All PHP « IT news, forums, messages
trying to access variable on different pages with reigster_globals = Off

Posted by Paul on 04/05/07 18:44

I am taking over an exisitng app. I have the following function on page1:
function check($v) {
global $user;
return $user->validate($v[1], $v[0]);
}
It is in this validate function of that class (which is referenced from
another file) that the $user object is set. $user is referenced on page2
like:

session_register('user');
$user=$_SESSION['user'];

since the ini setting register_globals is Off so the above code fails -
$user is empty.

Any ideas to how to make sure $user is accessible on the second page?

 

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

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