Brett Posted March 19, 2011 Share Posted March 19, 2011 Hi guys i'm brand new here, By the way im loving this book. My problem is im getting two errors, I have just finished the index page on the first example this is the first error i get PHP Warning: error_log() [<a href='function.error-log'>function.error-log</a>]: SMTP server response: 550 5.7.3 Requested action aborted; user not authenticated in C:\inetpub\wwwroot\includes\config.inc.php on line 18 This is my config.inc.php so far <?php $live = FALSE; $contact_email = 'evildoa@live.com'; //deine the constants define("BASE_URI", "../"); define("BASE_URL", "wwww.brettsite.com/"); define("MYSQL", "./includes/mysql.inc.php"); session_start(); //error handling function my_error_handler($e_number, $e_message, $e_file, $e_line, $e_vars){ global $live, $contact_email; $message = "An error accured in script '$e_file' on line $e_line:\n $e_message \n"; $message.= "<pre>".print_r(debug_backtrace(),1)."</pre>\n"; $message.= "<pre>".print_r($e_vars,1)."</pre>\n"; if ($live){ echo '<div class="error">'.nl2br($message).'</div>'; } else { //error_log($message,1, $contact_email,'From: evildoa@live.com'); } if ($e_number != E_NOTICE){ echo '<div class="error">A systen error accured. We apologize for the inconvenience.</div>'; } return TRUE; } set_error_handler('my_error_handler'); Notice ive commented out this line error_log($message,1, $contact_email,'From: evildoa@live.com'); It runs ok when this is commented out but in the borwser i still get a A systen error accured. We apologize for the inconvenience. notice right at the top of my content besides i can't get the smtp to work i can't see where im going wrong in mozzilla there don't seem to be any errors i can see through fire bug.... I'm SO LOST.... any advice will be a help thanks in advance Link to comment Share on other sites More sharing options...
Larry Posted March 21, 2011 Share Posted March 21, 2011 Thanks for the nice words. The issue is that PHP is unable to send out the email with the error that occurred. The solution to that depends upon the OS in use, the mail server in use, and the version of PHP in use, none of which do you indicate (per the forum guidelines). You also have a problem in your conditional. It should be if (!$live) The emails should be sent out if the site is live. If the site is not live, the errors should be displayed in the browser. Link to comment Share on other sites More sharing options...
Recommended Posts