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

Posted by Captain Paralytic on 07/26/07 12:22

On 26 Jul, 12:58, John H <john.heathc...@gmail.com> wrote:
> Hi,
>
> I'm busy fiddling with sessions under PHP5, and very quickly learned
> what I would have found out even sooner in the PHP manual - declaring
> your session variable on page1.php makes it available on page2.php
> (assuming that's the next page you load) but doesn't then make it
> available on page3.php unless you respecify it on page2.php. I'm sure
> there's a very good reason for it, and I know I can get around it by
> using a database and the session ID, but I would really like to know:
> why? I've already searched, but can't find any more information on the
> issue.
>
> Thanks,
> John Heathcote

You've got to be careful about your language when dealing with php and
other such languages, when considering web pages.

You have said: "declaring your session variable on page1.php".

Now do you mean "on the web page that is displaed as a result of
executing page1.php", or "in the script file page1.php".

This is important because there does not need to be a one-to-one
relationship between a .php file and a web page.

One php file may display zero, one or more than one web page.
Alternatively a web page may be made up of output from more than one
php script file.

 

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

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