Forum Moderators: coopster
function sendError($err="") {
die("<br />\n<b>Error</b>: ".$err."<br />\n<b>File</b>: " . __FILE__ . "<br />\n<b>Line</b>: " . __LINE__ . "<br />\n");
}
Which is called within the class:
if (is_file($filename)) {
$this->sendError('File exists!');
}
Now the error it outputs gives the file and line of the class file, and not the actual file and line it was called from. If you imagine the class is being included in say "index.php" then I want it to say File: index.php not File: class.php
Thanks,
Jas
function sendError($file, $line, $err="") {
die("<br />\n<b>Error</b>: ".$err."<br />\n<b>File</b>: " . $file . "<br />\n<b>Line</b>: " . $line . "<br />\n");
}
if (is_file($filename)) {
$this->sendError( __FILE__ , __LINE__ , 'File exists!');
}