Hello,
Does anyone know how I could possibly prevent a script from being run by more than one user at the same time on PHP4?
I have a script that has to do some maintenance on a web site.
It is called on every page because cronjobs aren't permitted on the server.
Of course, the script was designed in such a way that the maintenance is skipped when it's already done.
The problem is that when I refresh a page from two different computers at the same time, it disrupts the maintenance process. It seems that the script doesn't have enough time to find out whether or not the maintenance has been already completed.
I could call the script only from the home page but there is a possibility that two users hit that page at the same time.
Any solution?
Does anyone know how I could possibly prevent a script from being run by more than one user at the same time on PHP4?
I have a script that has to do some maintenance on a web site.
It is called on every page because cronjobs aren't permitted on the server.
Of course, the script was designed in such a way that the maintenance is skipped when it's already done.
The problem is that when I refresh a page from two different computers at the same time, it disrupts the maintenance process. It seems that the script doesn't have enough time to find out whether or not the maintenance has been already completed.
I could call the script only from the home page but there is a possibility that two users hit that page at the same time.
Any solution?