Thank for your help today Ray. One other thing, the documentation states that you should verify the 'action'. I did this by editing the if statement like so:
<?php
$respObj = json_decode($resp );
if ($respObj->success && $respObj->action == 'homepage') {
if ($respObj->score < 0.5) {
header("location: " .$_SERVER["REQUEST_URI"]);
die();
}
} else {
header("location: " .$_SERVER["REQUEST_URI"]);
die();
}
?>
Would this be ok?