You are here: Re: Passing session variables across pages « PHP Programming Language « IT news, forums, messages
Re: Passing session variables across pages

Posted by Toby A Inkster on 05/02/07 11:35

K. A. wrote:

> Step 2. A page called login.php that takes the posted username, stores
> it as $_SESSION["username"], and registers it
> session_register("username"); user is taken to the personalized page
> according to his username and things are fine up to here. (this page
> is not displayed, only for redirecting purposes).

session_register() is old-style register_globals-type code. Remove it.

> Next, I did exactly the same steps on server B; at step 2 (above) user
> is directed to the correct page. But when I get to step 3, the session
> seems to lose or set all its variables to NULL (I checked this using
> var_dump($_SESSION)).

You remembered session_start()? You need to call that before trying to
access $_SESSION.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Now Playing ~ ./vol/music/lisa_germano_-_wood_floors.ogg

 

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

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