Hi, this is my current exception,
try
{
if(!$this->isDataValid())
throw new Exception('You Have Entered Invalid Characters In The Form.');
if(!$this->checkToken())
throw new Exeption('Please Try Again Later, Or Contact Us For Help.');
if(!$this->sendToDB())
throw new Exeption('You Have Entered An Incorect Email Or Password.');
}
catch(Exception $e)
{
$this->_formErrors[] = $e->getMessage();
}
With this, the isDataValid is going to prevent sql injection by causing an error if it finds invalid characters, If it does find invalid characters will the exception end right there or will it carry on and run the other two ‘if’s’ and then flag the error? I don’t want it to find invalid characters and then run the sendToDB function because that would defeat the purpose of having the isDataValid function.
Many Thanks
Chris