kurt.santo Posted April 14, 2008 Share Posted April 14, 2008 When putting the following file: // error handling// flag variable for site status$live = FALSE;// error log email address$email = 'testing@domain.co.uk';// create error handlerfunction my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { global $live, $email; // build the error message $message = "An error occurred in script '$e_file' on line $e_line: \n<br />$e_message\n<br />"; // add the date and time $message .= "Date/Time: " . date('n-j-Y H:i:s') . "\n<br />"; // append $e_vars to the $message $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n<br />"; if ($live) { // don't show the specific error error_log ($message, 1, $email); // send email // only print an error message if the error isn't a notice if ($e_number != E_NOTICE) { echo 'A system error occurred. We apologize for the inconvenience.<br />'; } } else { // development (print the error). echo '' . $message . '<br />'; }} // end of my_error_handler() definition// use my error handlerset_error_handler ('my_error_handler'); outside of web root the page referencing it does not display any more. Why cannot it be outside of web root? Thought would be better for security...Kurt Link to comment Share on other sites More sharing options...
Lulzim Posted April 14, 2008 Share Posted April 14, 2008 You cannot open a file that is outside www root from a web browser. If you want to make it more secure, put it outside www root, but include it in a file that is inside www root. PHP scripts can access files even if they are otuside web root. Link to comment Share on other sites More sharing options...
kurt.santo Posted April 15, 2008 Author Share Posted April 15, 2008 You cannot open a file that is outside www root from a web browser. If you want to make it more secure, put it outside www root, but include it in a file that is inside www root. PHP scripts can access files even if they are otuside web root.Cheers, will have a go...Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.