0

Hello to all,

I had a browser that does not update the content of a website so I asked for help on a forum and someone suggested to use this code:

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");

When I work on XAMPP I have not problem but when i use a real hosting I get a file named "error_log" that fills the Following lines of code:

[15-Mar-2016 02:21:25 Europe/Berlin] PHP Warning:  Cannot modify header information - headers already sent by (output started at /…/index.php:1) in /…/index.php on line 3
[15-Mar-2016 02:21:25 Europe/Berlin] PHP Warning:  Cannot modify header information - headers already sent by (output started at /…/index.php:1) in /…/index.php on line 4
[15-Mar-2016 02:21:25 Europe/Berlin] PHP Warning:  Cannot modify header information - headers already sent by (output started at /…/index.php:1) in /…/index.php on line 5

I wish the browser That did not keep the memory of the index.php page and That my server does not write error_log file. How can I do? Is there a solution?

Thank you

user3212453
  • 11
  • 1
  • 6
  • You can only set header information before you start to output any content of the page. Make sure you don't output *anything* before calling `header()` - even a space or linebreak – Horen Mar 20 '16 at 21:56
  • just another headers already sent thread. the reason is some output before sending headers. but you will be marked as dublicate soon.. please search this page for the error by yourself. – steven Mar 20 '16 at 21:56
  • i think your php open tags are not the very first chars of your file. but it is just a guess because you didnt post your whole file. – steven Mar 20 '16 at 21:59
  • My file begins with this code: '' there are no spaces! I do not understand. – user3212453 Mar 21 '16 at 17:36
  • I do not understand how I can remove the linebreak. If I do not use a linebreak my code turns out to be wrong. Here's an example: " – user3212453 Mar 21 '16 at 17:52

0 Answers0