What I want is this script to exit if there is nothing posted in the $_GET. Do I need the try to be a function? I don't really care if I see the $e error message I just would like the script to completely exit if the variable is not set. If it goes through the rest of the script I will get a bunch of fatal errors.
Try{
$addrarray = $_GET['addr'];
if (! isset($addrarray)){
}catch(Exception,$e){
echo 'Caught exception: '.$e->getMessage(). "\n";
exit("The supplier you selected is not located in that State.");
}
I am having trouble figuring out how to create a function for the Try block like the php.org examples because I would have to pass it the $addrarray and if i did that and it wasn't set I would get an error before sending it to the function.
thanks,