Re: Application Scope variables ?
Then the answer is easy. Apache has no concept of an "applicatio n". It is simply a web server which waits for requests and issues responses. PHP also has no concept of an "applicatio n" in the way you describe for IIS/ASP. However, you can achieve the same functionality by using config files, sessions, and/or databases.
--
Tony Marston
"aa" <aa@virgin.ne t> wrote in message news:41515c7c$0 $69739$ed2619ec @ptn-nntp-reader01.plus.n et...
You missed me, Tony. Of course I did not mean application==we bserver
"Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message news:ciqd4r$o7m $1$830fa7a5@new s.demon.co.uk.. .
If by "applicatio n" you mean "web server" then it is not common practice to stop the web server when the last client has finished. A web server usually runs 24/7 so that it is available whenever somebody wants to access it. If you are talking about a closed application such as on a company's intranet which may only be available during certain times of day then shutting down the web server does nothing more than shut down the web server. There is no concept of running any closedown routines for whatever application may have been accessed during the time the web server was running. A web server like Apache is merely a vehicle for servicing HTTP requests. It serves up html documents or php documents or whatever. Those documents are the application. It has no knowledge of any particular application which it may run. Why should it?
--
Tony Marston
"aa" <aa@virgin.ne t> wrote in message news:41508cf8$0 $17960$ed2619ec @ptn-nntp-reader02.plus.n et...
"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."
That is not necessary to tell, for the actions of a particular visitor are not relevant.
As it happens with Windows/IIS/ASP, Application can either be closed manually, or it times out if there are not requests for a preset period of time. In other words, application closes when the last active session times out.
Is this the case with Apache server?
"Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message news:cipsgh$npr $1$8302bc10@new s.demon.co.uk.. .
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?
Then the answer is easy. Apache has no concept of an "applicatio n". It is simply a web server which waits for requests and issues responses. PHP also has no concept of an "applicatio n" in the way you describe for IIS/ASP. However, you can achieve the same functionality by using config files, sessions, and/or databases.
--
Tony Marston
"aa" <aa@virgin.ne t> wrote in message news:41515c7c$0 $69739$ed2619ec @ptn-nntp-reader01.plus.n et...
You missed me, Tony. Of course I did not mean application==we bserver
"Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message news:ciqd4r$o7m $1$830fa7a5@new s.demon.co.uk.. .
If by "applicatio n" you mean "web server" then it is not common practice to stop the web server when the last client has finished. A web server usually runs 24/7 so that it is available whenever somebody wants to access it. If you are talking about a closed application such as on a company's intranet which may only be available during certain times of day then shutting down the web server does nothing more than shut down the web server. There is no concept of running any closedown routines for whatever application may have been accessed during the time the web server was running. A web server like Apache is merely a vehicle for servicing HTTP requests. It serves up html documents or php documents or whatever. Those documents are the application. It has no knowledge of any particular application which it may run. Why should it?
--
Tony Marston
"aa" <aa@virgin.ne t> wrote in message news:41508cf8$0 $17960$ed2619ec @ptn-nntp-reader02.plus.n et...
"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."
That is not necessary to tell, for the actions of a particular visitor are not relevant.
As it happens with Windows/IIS/ASP, Application can either be closed manually, or it times out if there are not requests for a preset period of time. In other words, application closes when the last active session times out.
Is this the case with Apache server?
"Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message news:cipsgh$npr $1$8302bc10@new s.demon.co.uk.. .
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