Jump to content

Recommended Posts

Use fopen and flock. The file will be locked until unlocked or closed. If it cant get a lock its best to let it sleep for a microsecond or so otherwise the script will keep trying. But because you have it locked does not mean that another user cant open it, they can, they just cant write to it.

 

 

HTH

Teamatomic

What exact method are you using to edit the web page? A programming editor running on a computer or a web form in a browser? Are you actually editing the source of the page or are you editing content in a database that a web page then displays?

 

In general, you would need to use a semaphore in a file or a database to restrict access to one person at a time. Since php functions like flock release the lock when the script on a page ends, they would not directly be usable if a web form is being used to edit the web page in question.

im creating a program that a user can add/edit data in my webpage. but they are requesting to avoid multi user to edit a data. im currently using a database to store a counter for the data that is in use by a user and i only allow one user to edit a data in my webpage. i just want to think of some way to do that and i've searched in google and they're suggesting the same thing... there are other methods but i can't really understand it.. :(

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.