|
I've never used PHP, but I have an idea you can try. In C, you have the tmpfile() and tmpnam() functions; these create a temporary file in the current directory and a unique name for a temporary file. I'm assuming that PHP may well have something similar. You can then have both users create a file (each file will have its own unique name), and when one submits, it tries to rename the file as xxx.php, with xxx being your incrementing value. One of these rename attempts (ie, the first) should work; the other will not, and will raise an error/exception/whatever. If you detect this error condition, increment and attempt the rename again.
Given that this situation should only arise when two people try to save the form at the same moment, it shouldn't be a very frequent occurrence.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
|