PDA

View Full Version : Limiting the process to run by 1 user only ?


SCSCSC
07-11-2009, 06:52 AM
Hello,

I have coded a custom mod.

in that there is a process like..


//its an auction system

if($_REQUEST['do']=='placebidprocess')

{
// some process
// here i also have put one condition that if presentbid>newbid then it prints error
// later if all fine it updates the value of presentbid as the newbid amount

}

but this doesnt help me when 2 ppl run this process at the same time..
so the problem is when 2 ppl do it as same time.. 2 identical bids are placed by 2 differnt users
how can i avoid such a problem ?

thank you

ranz
07-11-2009, 12:18 PM
Not really sure what your trying to achieve, but I'll try to answer based on what you've shown here.

One option is that you could use record locking in your database and then use php to check if the record is locked due to concurrent users and send to an error/alternate page.

Another option is that you may have to play around with sessions/cookies and there is plenty of example code for this via Google search.

I'll have a peek and see what I can dig up for you.

SCSCSC
07-12-2009, 05:30 AM
Hi thanx ranz.
its basically a Auction System
and this is the Bid Process

So the problem i occur is that when 2 ppl place bids at the same instant of time.
then two identical bids are placed.