You can simply redirect the error action to a new page like
error.php by adding a header location marked in blue color.
Code:
require_once('recaptchalib.php');
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
header('Location: error.php');
exit();
}
and then you can create a link or form to get back to the registration page.
Thanks to the developers of this script.