Re: Application Scope variables ?

From: aa (aa_at_virgin.net)
Date: 09/21/04


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.
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Relevant Pages

  • Re: Application Scope variables ?
    ... Actually I have suggested that myself, but hoped that there is more elegant ... >> Session will only make such a variable available within this session. ... > Tony Marston ...
    (comp.lang.php)
  • Re: Checking SQL_TRACE status of a particular session
    ... But if I would like to check on ALL THE SESSION, ... I am sure there is a more elegant way with oradebug, ... for cur in (select spid ... where s.paddr = p.addr) loop ...
    (comp.databases.oracle.server)
  • RE: question regarding SAM file / l0phtcrack / pwdump2
    ... user list through a NULL session, the list contained about 30 userids, ... So then I proceeded to retrieve the SAM file using PWDUMP3 as I ...
    (Focus-Microsoft)
  • Re: Problem with asp.net app only allowing 1 user at a time
    ... from the client to the server), Application (an object that can store ... Now in your case you are reading and writing everything to the database, ... there is the Session object. ... To retrieve this you would do something like: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Missing links in RTP streaming solution
    ... could retrieve this data and set the type of the Source ... signalling protocol, e.g. RTSP or a custom one, to negotiate ... Usually, session establishment takes place ... (or upon connection of the input pins for other filters). ...
    (microsoft.public.win32.programmer.directx.video)