php scripting, stopping script if condition fails

[php]<?php
if(strlen($guardians_phone) < 8){
echo ‘ERROR: guardians_phone is too short’;
}else{
echo ‘Congratulations!’;
}
?>[/php]

I would like this condition to stop the execution of the form if the answer is false. Would also like to redirect to an html page that would explain to the person why the script failed. Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service