Reply to Re: Session variables across multiple pages

Your name:

Reply:


Posted by John H on 07/27/07 09:29

On Jul 26, 3:26 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> John H 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
>
> It should be available on every page you load - as long as you call
> session_start() at the beginning of the page.

Thanks to everyone for their help - I eventually found the problem on
my side with session_start() not being declared on a few of the pages
- I've now got a require() function on my template to put in the
appropriate headers, including session_start(). Also, thanks to
Captain Paralytic - I described the problem thus to simplify matters,
but yes, I was talking about a single html page at a time with php
script inside it. Your point, however, is well taken.

[Back to original 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

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