Alex Rivera | Logout

PHP: how to know if output already started?

Asked 2011-01-20T21:16:58.633
14

I use the same php script for including and for ajax loading. It is some random catalog items which are loaded with the page and can be loaded with ajax. I need to use header() function there only if it is loaded via ajax.

When I use header function and the output already started I get php warning about it. How does php know that output already started? What is the best way to determine that, and not to call header function?

Thanks.

Edit
Report

1 Answer

2

headers_sent() returns true if you cannot send additional headers.

answered 2011-01-20T21:21:04.843

Your Answer