lock page. possible?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
yarons
Forum Newbie
Posts: 24
Joined: Mon Sep 11, 2006 7:25 am

lock page. possible?

Post by yarons »

Hi,

I was wondering if it was possible to lock a specific php page/script if a user is currently running it.
i.e. only 1 user can run or even access this page at a time.
I'm using php version 5.1.6 and apache 2.2.3

Thanks
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Yes. Make sure the user is running a session. Store that session ID in the database upon accessing the page, along with the timestamp. Clean up the database to remove the session ID if the timestamp associated with it is more than say 30 minutes old.
Post Reply