You are here: question about using "global" on one page then using the variable on another page « PHP Programming Language « IT news, forums, messages
question about using "global" on one page then using the variable on another page

Posted by Paul on 04/05/07 17:28

I am taking over an exisitng app. I have the following function on one
page:

function check($v) {
global $user;
return $user->validate($v[1], $v[0]);
}

And it reference $user on the next page. Register_globals are set on the
existing server but I am moving to a new server where it is not. The code
of the next page is lilke:

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

I also want to turn it around so it's:
$_SESSION['user'] = $user;

But that fails - $user is empty. By the way, $user is an object.

Any ideas to how to make sure:
$_SESSION['user'] = $user;

works 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

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