Click to See Complete Forum and Search --> : Double Browser Requests


DaiWelsh
09-09-2003, 07:28 AM
I am posting this here because I dont think it relates to my server model (PHP/MySQL/Apache for the record) from the comments I have seen on it elsewhere on the web.

I have users reporting odd problems with double inserts into a database. The problem only appears to affect certain users and is intermittent for them.

I have run through the process with one user via chat software and confirmed that the pages appear fine but there seem to be two seperate requests to the server in response to them clicking a submit button just once (I log the call to the page into a db with a random number to confirm that it appears to be two seperate requests rather than a logic error causing the insert code to loop twice).

The sequence is

1. Script called first time, delivers page where user selects options (form with POST method submits to self). this is requested once, form appears to be valid and contain correct data so all is well at this stage.

2. Same script when submitted to with form contents does insert one or more times depending on options. This time it appears to be requested twice even though user clicked button once and there is no onClick javascript or anything like that.

Is anyone aware of any bugs or issues that can cause this duplicate request behaviour? I have googled but it is hard to figure out good search terms and the best I have found is isolated reports by other developers with possibly similar problems but no solutions.

Grateful for any pointers,

Dai

Khalid Ali
09-09-2003, 07:43 AM
I have come accros this problem..god knows when,but I can not remember why,post a link and I'll see if reminds of the problem causes.

DaiWelsh
09-09-2003, 08:03 AM
Can't post a link to the page as it is password protected app and I dont have access to dl the page from here, but it behaves the same for several pages within the app according to the problem users so I dont know that the specific html is relevant (though it may be of course).

From the user point of view it looks exactly as though they did one request and got one response, but two items are inserted.

Thanks for looking anyway.