Reply to Re: how to lock a block of php codes

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация