Re: how to lock a block of php codes
- From: "peter" <submit@xxxxxxxxxxxxxxxx>
- Date: Wed, 25 Oct 2006 18:07:37 +0100
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.
.
- References:
- how to lock a block of php codes
- From: kelvin
- Re: how to lock a block of php codes
- From: bob.chatman@xxxxxxxxx
- Re: how to lock a block of php codes
- From: kelvin
- Re: how to lock a block of php codes
- From: ED
- how to lock a block of php codes
- Prev by Date: Re: how to lock a block of php codes
- Next by Date: CURL Post?
- Previous by thread: Re: how to lock a block of php codes
- Next by thread: Using mysql_real_escape_string with sprintf
- Index(es):
Relevant Pages
|