Shotster wrote:Hmm, I just thought of something clever that might work. I'm going to try it and report back...
JavaScript to the rescue! Here's the simple change I made to the errors.php file to get my message output only once:
<?php
echo "<p id=\"errMsg\"></p>\n";
function handleIncludeError($errno, $errstr, $errfile, $errline)
{
$msg = 'Resource Temporarily Unavailable';
echo "<script type=\"text/JavaScript\">document.getElementById('errMsg').innerHTML='$msg';</script>\n";
}
$oldHandler = set_error_handler("handleIncludeError");
?>
Well ok, it is of course still output twice by the server, but a touch of client-side JS ensures the user sees it only once. And by simply editing a style sheet, I can alter the appearance of the message box on a per-page basis. Being a JS guru, I don't know why this didn't occur to me sooner. Anyway, my entire site relies on JS, so using client-side scripting is not an issue. In fact, it's preferred. I resort to PHP only when I have to.
Thanks for the input. I wanted to make sure I wasn't overlooking some obvious server-side solution.
Regards,
Steve