Hello All,
I am trying to incorporate an error handling schema on my website. I am using an errorReporting class with a function that will display the errors to error_display page. I really want this to show up on the page where the form generated the error.
So for example I verifying that array is not empty. If empty it creates a new error object with the appropriate properties to describe the error.
require_once "errorReporter.class.php"; $e = new errorReporter();
After the error is raised it is then displayed with this function of the errorReporter class.
// manually raise an exception
function raiseError($subtype=NULL, $data="No additional information available")
{
$this->_errors[] = array("subtype" => $subtype, "data" => $data);
if ($this->_getErrorType($subtype) < 1000)
{
// fatal
$this->displayFatalError($subtype, $data);
}
return $this->_errors;
}
function displayFatalError($subtype, $data)
{
ob_clean();
$errorType = $this->_errorTypes[$this->_getErrorType($subtype)];
$errorCode = $subtype;
$errorMsg = $this->_errorsubTypes[$subtype];
$addInfo = $data;
include ("fatal_error.php");
die;
}
Instead of redirecting to the fatal_error.php page I want the above variables to go to the page that generated the error displayed in a table cell.
What is the best approach to achieve this?
thanks