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
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