I dont think you understand what is happening here, you don't actually use PHP to do the validation you only you Javascript, the validation is done in the client side in real time (before the actual form is submitted), the javascript steps in before the form get passed and does the validation. you would construct the page as follows:
<html>
... MY HTML PAGE ...
<script language="javascript">
function checkform() {
if ( confirm("Send?") ) {
document.myform.jsanswer.value = 1;
} else {
document.myform.jsanswer.value = 0;
}
return true;
}
</script>
<form action="ThisPage.php" name="myform" method="get">
<input type="hidden" name ="jsanswer">
<input type="submit" name="submit" value="Send"> </form>
</html>
hope you understand this.🙂