Stumper: Get Variable Name
| From: | Michael Smith | Date: | Tue, 08 Jul 2003 21:54:04 +0000 |
| Subject: | Stumper: Get Variable Name | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154445@lists.php.net to get a copy of this message | ||
Alright, I've got an error reporting class with a report() method.
I want to be able to e-mail myself the name of the variable that bombed out and the line that it was on (as well as the filename) if possible. Don't really know where to start... looks like this:
function report ($error_var) {
include ("variables/global.var.php");
require ("admin/classes/class.phpmailer.php");
require ("admin/classes/class.smtp.php");
$mail = new PHPMailer();
//set the variables we need
$mail->From = $smtp['from'];
$mail->Subject = "Reporting A PrattCMS Error";
$mail->FromName = $smtp['fromname'];
$mail->Host = $smtp['host'];
$mail->Mailer = "smtp";
$mail->SMTPAuth = $smtp['auth'];
$mail->Username = $smtp['user'];
$mail->Password = $smtp['pass'];
$mail->Helo = $smtp['helo'];
$body = "We regret to inform you that ";
}
and I want to be able to tell myself what the variable's name was, the line it errored out on, etc.
Thanks!
-Michael
--
Michael Smith
IT Intern
msmith@prattmuseum.org
If computers get too powerful, we can organize
them into a committee -- that will do them in.
-Bradley's Bromide