Re: Application Scope variables ?
From: aa (aa_at_virgin.net)
Date: 09/21/04
- Next message: Michael Fesser: "Re: MySQL/PHP - Query Form"
- Previous message: aa: "Re: Application Scope variables ?"
- In reply to: Tony Marston: "Re: Application Scope variables ?"
- Next in thread: Lucas: "Re: Application Scope variables ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 21 Sep 2004 21:10:12 +0100
> Then do what other people have already suggested:
Actually I have suggested that myself, but hoped that there is more elegant
solution
Thanks.
"Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
news:cips55$sjm$1$8300dec7@news.demon.co.uk...
>
> "aa" <aa@virgin.net> wrote in message
> news:415055cf$0$42237$ed2e19e4@ptn-nntp-reader04.plus.net...
> > Session will only make such a variable available within this session.
> > But I am talking about a variable available from any page from any
session
>
> Then do what other people have already suggested:
> (a) Store those variables in a database.
> (b) Use a configuration which you can include() in every script.
>
> There are no application-level variables in PHP which persist across pages
> and sessions, so get used to it.
>
> --
> Tony Marston
>
> http://www.tonymarston.net
>
>
>
> > "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
> > news:cip0pa$ig4$1$8300dec7@news.demon.co.uk...
> >>
> >> "aa" <aa@virgin.net> wrote in message
> >> news:415002f7$0$42212$ed2e19e4@ptn-nntp-reader04.plus.net...
> >> > Thanks.
> >> > You mean that PHP does not allow to store application-level variables
> >> > in
> >> > memory and every time I need to modify such a variable I have to
> > retrieve
> >> > it
> >> > from disc (a file or DB) and then to write it back?
> >>
> >> If you want to store variables between one page and another the PHP way
> >> is
> >> sessions. All you need is session_start() at the beginning of each
> >> script.
> >> This will create an empty $_SESSION array the first time, then give you
> > back
> >> everything you put in it.
> >>
> >> Note that you do not have to write the session data out to file
manually
> > as
> >> PHP will do it automatically for you at the end of the script. It's all
> >> in
> >> the manual.
> >>
> >> --
> >> Tony Marston
> >>
> >> http://www.tonymarston.net
> >>
> >>
> >>
> >> > "Zurab Davitiani" <agt@mindless.com> wrote in message
> >> > news:ALJ3d.21759$Lf5.2677@newssvr27.news.prodigy.com...
> >> >> > your thinking is still too influenced by the rigid ASP structure.
> >> >> > Relax, open your mind and RTFM on sessions. :-)
> >> >>
> >> >> Session variables are not the same as application-level variables.
ASP
> >> >> offers an application framework, ASP *is* the framework.
> >> >>
> >> >> Having said that, you can replicate functionality via PHP by either
> > using
> >> >> common files for variable storage/retrieval, or using a database.
Some
> >> > info
> >> >> should be easily locatable by searching.
> >> >
> >> >
> >>
> >>
> >
> >
>
>
- Next message: Michael Fesser: "Re: MySQL/PHP - Query Form"
- Previous message: aa: "Re: Application Scope variables ?"
- In reply to: Tony Marston: "Re: Application Scope variables ?"
- Next in thread: Lucas: "Re: Application Scope variables ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|