Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

RE: [PHP] lock web page when editing From: Joe Kaiping (kaiping <email protected>)
Date: 09/29/01

Another possibility:

1. keep track of the last modification time for that page when a user
requests to start editing the page

2. lock the page only immediately before the script does the write and then
unlock it immediately after. (that way a file never is left locked)

3. don't allow the write to happen if the last modification time is
different from the time when the user started applying edits. (If it's
different then that means there was an update since that user started
applying her edits. If that's the case, you would prompt the current user
that there has been an update since she started making the changes and that
she needs to reload the page being modified to before she can apply those
changes.)

---

And yet another approach is to put the pages (if just files) into CVS and have the content management scripts be a UI to the CVS commands used to manage those files.

I've implemented this approach for a customer and it works nicely. CVS allows locking or merging options depending on how strict you want to be.

If curious about CVS, check out http://www.cvshome.org/.

-Joe

> -----Original Message----- > From: Bob [mailto:whyisityou2 <email protected>] > Sent: Saturday, September 29, 2001 2:28 PM > To: php-general <email protected> > Subject: [PHP] lock web page when editing > > > hi > > just seeing how everyone would approach this problem. > > i'm building a content management system and many people can > edit a web > page. if someone clicks on "edit" for a web page then i want to lock > that page and not allow anyone else to "edit" the same page until the > first person is done. how would i be able to tell if that > first person > is still editing or they have left??? if they close the browser then > the web page would be locked forever. how do i get around that? > > > > _________________________________________________________ > Do You Yahoo!? > Get your free  <email protected> address at http://mail.yahoo.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe <email protected> > For additional commands, e-mail: php-general-help <email protected> > To contact the list administrators, e-mail: > php-list-admin <email protected> >

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>