Like this---this is just an example---apply it to your specific case. If you're unclear on anything, visit www.php.net
<?php
//Create a random number (not necessarily in your script)
$random_number = rand(0,1);
if ($random_number==0) {
//die ends the script and outputs a message.
die ("Terminate the script: the random number was zero.");
} else {
echo "Your number was 1."
//Code in here---execute whatever code you want.
}
?>