Posted by peter on 10/25/06 17:07
> Hi Kelvin,
>
> I generally use a text file as a lock so:
>
> $fp = @fopen("lock.txt", "w+"); //open lock file
> if ($fp && (flock($fp, LOCK_EX))) {//place an exclusive lock on the file
> //do stuff
> @fclose($fp); //release Lock
>
> cheers
> ED
In all honesty in this instance it maybe better to keep a log of the
transaction id's (paypal creates a unique transaction ID for each 1). Simply
store this id in a database of some kind and if it already exists do not
process it again.
[Back to original message]
|