optimistic locking in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yanis97
Forum Newbie
Posts: 1
Joined: Wed Jun 09, 2004 3:48 am

optimistic locking in PHP

Post by yanis97 »

Hi;

How manage in PHP when several users would like to modify the same form (web page) in disconnection mode ?
If I lock (via MySql) the form, so if the user close web browser => which solution ?
Have you a solution to resolve the complex problem in PHP ?

Best regards;
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Do I understand you correctly in that you want to have PHP handle form-input when the users are offline?

If that's so, you'll need a connection to the server at some point, otherwise PHP can't handle the form-input. You can users simply have fill out the form and submit to php-script which does everything you'd need (e.g. email it to someone, update the database etc.).
Or you could use javascript to create an email based on the form input, in which case you'll need to buffer the form-submit.
Parsing that email with PHP is not the easiest way, but it's not too difficult.

Generally, at some point the users will need to be online to submit the data, otherwise PHP can't handle it.
Post Reply