I have a strange issue here – see below.
Page X
- Contain a form having method as post
- User submits the form – There some form validation.
- If everything validates I save the data, set a flash data message in the session (i.e. query success/failed) and redirect() the user to current_ur()
- Now, I can see the flash message and If I press F5 – I get do you want to submit the form again?
Shouldn’t this just refresh the page? How do I stop it making another submit request?
If I redirect to Page Y, and press F5 there, then it doesn’t ask me to resubmit? I am lost here!
OK guys
This is NOT a
CodeIgniterissue. It is an issue withFirefox. I’m using14.0.1version ofFirefox.I have tried the same form and process in
IE 7, 8, 9,Safari 5,Chrome(latest) – they don’t show me the confirmation dialog box to re-submit the form onF5.Update
In firefox I get this message –
I just setup another script (without CI) and tested in Firefox. I tried to create the similar process (i.e. post and redirect to same page) … I don’t get this message at all. Refresh works just fine. So I take Its back on to CI now?
Update 2
OK I think I have cracked it now –
I’m using CI’s redirect function – see below – the second parameter takes default value as ‘auto’ and when it’s
autoit sends header asheader('Refresh:0;url='.$uri);which makes the Firefox throw the above message. As mentioned above, I don’t get the same behaviour in other browsers. I hope it helps someone.