how to prevent post on refresh?
I have the form page which is validuseragent.php http://codepaste.net/59zke3 and the page that posts everything called useragentinput.php http://codepaste.net/ejzmb6 Now when I hit submit on the first(form) page, it will go to the second page and post the output ..on the second page, if you hit refresh or enter, it will keep posting the comment over and over which I don't want it to do. I've been reading about headers such as placing markupheader("location: page.php");
in the code, but It's not working, any advice or ideas?
Havn't looked at the code, but header() must be called before any output is printed. You can't have output if you are sending a relocate header. Also, the 'L' in location is a capital.
You could also look at Javascript redirects.
Most people's browsers will handle this for you though, and alert them if they try and refresh a page they just sent POST data to.
EDIT: Erm, also, just so you know: User agents can easily be spoofed and should not be used as a security mechanism.