Jump to content
Larry Ullman's Book Forums

Headers Sent Already Error In Live Mode


Recommended Posts

Hi,

 

I was excited to upload my bunch of scripts, as they were working fine on my own computer and browsers. I uploaded index page and its related include files, just to see what happens. And there it goes.. the headers already sent errors dropping in my email boxes. And the browser shows following error too..

Fatal error: Cannot redeclare my_error_handler() (previously declared in /home/myreadin/includes/configr.inc.php:20) in /home/myreadin/public_html/configr.inc.php on line 53

 

I'm using chapter 15 and 16 examples to write register, login and logout scripts. So I don't understand why and how these errors are showing up? Help please...

Link to comment
Share on other sites

You can deal with "headers already sent" by using output buffering. I don't have the 3rd Edition, but in the 2nd Edition there is a section devoted to output buffering in Chapter 11. Check the index of your book and you should find it.

 

As for your fatal error, it looks like you have your error handler function in an included file (configr.inc.php), but you are re-declaring it in the script displaying the error, or maybe it is in another include file. Basically, the error message is stating that you can't have two functions with the same name, even if it is the same function.

Link to comment
Share on other sites

<quote>

As for your fatal error, it looks like you have your error handler function in an included file (configr.inc.php), but you are re-declaring it in the script displaying the error, or maybe it is in another include file. Basically, the error message is stating that you can't have two functions with the same name, even if it is the same function.

 

Thanks a lot for the reply. I got the solution for "headers already sent" errors, and they are not showing up. But fatal error is still there. Yes, the error handler function is in included file, configr.inc.php. It is only declared in this file on line no 20.And then it is called to show errors through "set_error_handler" function in the same file, at line no. 53. It is not redeclared anywhere else. And this error shows up only in LIVE mode, ohterwise the script works fine in development mode.

Thanks again

Link to comment
Share on other sites

 Share

×
×
  • Create New...