Forums / General Questions / How did she know "headers already sent" was junk in file?

How did she know "headers already sent" was junk in file?

Views: 1,252

Results 1 to 3 of 3
2 Jul 2015, 4:56 PM
#1
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

How did she know "headers already sent" was junk in file?

I was getting a lot of warnings in my log files:
"Php warning: Cannot modify header information - headers already sent <file one> <file two>

and <file one> was always the same file, <file two> varied. I was going to edit file one because that is what I was working on yesterday but I wasn't sure what to look for.

I searched on "headers already sent" and found this response by Ajeh:

Based on the error message, check the file:
<file one>

and remove the space(s) blank and/or line(s) at the start of the file before the opening php bracket <?php and see if this corrects the problem ...

As a precaution, check at the bottom of the file and if there is a closing php bracket ?> remove that as well .

It worked. I had leaned on my keyboard or something before I closed the file yesterday and there were some random characters at the top.

My question is twofold:

  1. How did she know (just experience or was it a specific behavior of the header files?
  2. Why is their no closing php bracket?

My guess is that it is something about the way the developers structured zencart?

Thank you Ajeh for the solution and anyone for the explanation. Also, I started a new thread because this was buried in a template forum.

PS: I didn't post the file name because mine was different than the original post so I thought it didn't matter. But it case it does, I was editing meta_tags.php in includes/modules/mytemplate/

2 Jul 2015, 6:07 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How did she know "headers already sent" was junk in file?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Jul 2015, 9:09 PM
#3
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Re: How did she know "headers already sent" was junk in file?

Thank you, I should have kept searching. Linda