clearing a URL parameter on form submit
I've incorporated Google reCaptcha into a form which sends two emails, one to the site owner and one to the sender. All works fine, however I'm having an issue with the URL ?sent=true and ?sent=false parameters.
If the reCaptcha is ticked and the form validates OK, it adds ?sent=true and the emails are sent. If the reCaptcha fails, it adds ?sent=false to the URL and displays the anti-spam error. But, if the user forgets to tick the reCaptcha first time around and then tries it again and ticks the reCaptcha, the URL ends up with two parameters, like this:
?sent=false?sent=true
Although the emails still send, the user doesn't get to see the success message as the trigger for that is<?php if(isset($_GET['sent']) && $_GET['sent'] == "true") { ?> and the form contents also aren't cleared so it looks like it hasn't been submitted at all. How can I clear the ?sent=false parameter if it exists when the form is then resubmitted successfully?