Re: Application Scope variables ?
To implement a hit counter in PHP I would use a database table.
There is no such thing as being able to detect when the application is closed. The client simply stops sending requests to your web site. Is he still reading the last page? Has he jumped to another site? Has he closed the browser? That is impossible to tell.
--
Tony Marston
"aa" <aa@virgin.ne t> wrote in message news:415058ee$0 $42257$ed2e19e4 @ptn-nntp-reader04.plus.n et...
Just to stream the discussion up - how a page hit conter in implemented in PHP?
In ASP you increment a relative Application scope variable every time a page is requested. This veraible is accessible from any session.
This variable is sitting in the memory as long as the Application (i.e. the website) is running.
If the Application is stopped, it fires an event "application_on _close" and on this event you write an application data to a file from which it can be recovered when the application is restarted.
How do I get the same effect in PHP?
"aa" <aa@virgin.ne t> wrote in message news:414eb86a$0 $80627$ed2619ec @ptn-nntp-reader01.plus.n et...
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters.
Is there a similar mechanism in PHP?
To implement a hit counter in PHP I would use a database table.
There is no such thing as being able to detect when the application is closed. The client simply stops sending requests to your web site. Is he still reading the last page? Has he jumped to another site? Has he closed the browser? That is impossible to tell.
--
Tony Marston
"aa" <aa@virgin.ne t> wrote in message news:415058ee$0 $42257$ed2e19e4 @ptn-nntp-reader04.plus.n et...
Just to stream the discussion up - how a page hit conter in implemented in PHP?
In ASP you increment a relative Application scope variable every time a page is requested. This veraible is accessible from any session.
This variable is sitting in the memory as long as the Application (i.e. the website) is running.
If the Application is stopped, it fires an event "application_on _close" and on this event you write an application data to a file from which it can be recovered when the application is restarted.
How do I get the same effect in PHP?
"aa" <aa@virgin.ne t> wrote in message news:414eb86a$0 $80627$ed2619ec @ptn-nntp-reader01.plus.n et...
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters.
Is there a similar mechanism in PHP?
Comment