Select Page

Just learned something unrelated to Lego I thought I’d share:

Programming languages are REALLY strict!

When not building Lego, collecting Lego, or reading about Lego I build websites.  Currently, I’ve been working with WordPress a lot.  In the natural progression of things, I decided I wanted to learn more.  I wanted to learn how to write my own plugins.

I found some tutorials, and when I was finally ready to test my first plugin, it kept bombing out on me.  I kept getting this error:

Warning: Cannot modify header information – headers already sent by <some file>

All I was trying to do was add a simple comment line in the <head> of the page.  After several hours of comparing my code to the tutorial, research, and hair pulling I finally found the problem.  I had a couple of extra blank lines after my closing php tag (?>).

SRSLY???

And to make matters worse, I noticed one blank line is fine.  Two blanks lines, you’re looking for trouble.

SMH

Any way, thought I’d share.  Hopefully some young enterprising programmer with the same issue in the near future will find this thread, and save some time!

Pin It on Pinterest

Share This