if(defined($_POST["message"]) && defined($_POST["name"]))
{
In that if block an exception is thrown constantly. I am looking for a function that will prevent this by testing if it the post variable exists..if it doesnt exists return false instead of throwing an exception
or if you want to check them to be not only set but also non-empty: