ZenphotoCMS Forum
Getting "Warning: Cannot modify header information" with template - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Getting "Warning: Cannot modify header information" with template (/thread-5341.html)



Getting "Warning: Cannot modify header information" with template - scottyd - 2009-06-15

So, I've installed zen photo and I am trying to plug it into my existing website using this info:

`

`
and now I get this PHP error on the page:

Warning: Cannot modify header information - headers already sent by ( output started at /home/content/b/l/a/blacksabbathmc/html/photos.php:12) in /home/content/b/l/a/blacksabbathmc/html/zenphoto/zp-core/functions.php on line 1791
I know it's got something to do with the sessions in the headers, but I am not sure what I need to do to fix it or where to go to fix it.

Any help would be awesome!
Thanks!




Getting "Warning: Cannot modify header information" with template - sbillard - 2009-06-15

Very likely you have some whitespace befor or after the PHP section. That is before ``




Getting "Warning: Cannot modify header information" with template - scottyd - 2009-06-15

I got rid of whatever whitespace that was in the file and it's still blowing the error.

Here's the link to the page:
http://blacksabbathphoenixmc.com/photos.php

Do I need to check any other pages?

Not too sure what else could be causing it?




Getting "Warning: Cannot modify header information" with template - sbillard - 2009-06-15

Where have you placed the above code? It needs to be the first thing in your file.




Getting "Warning: Cannot modify header information" with template - scottyd - 2009-06-15

Ok, I see now. I placed it in the beginning of the page and it went away.

I am a little confused tho. I am more or less trying to integrate it with a current site.
I was reading this:
http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin
Which is where I found the code, but I am assuming that there is more that needs to be done.
It seems that essentially that I use the default them and then use part of that code to put into the page on my site? I am not too sure what I need to do next?




Getting "Warning: Cannot modify header information" with template - sbillard - 2009-06-15

The above code merely instantiates a Zenphoto context on your home page. After doing that you will need to create code to show whatever Zenphoto object or item you want on that page. The particular example at that link puts a random image on the page. That is the second bit of code.

If all you wish to do is make it seem like your current page and Zenphoto are seamlessly integrtated it can be much simpler. You would not need that code, just a link to your zenphoto gallery somewhere on your page. Plus, change the Zenphoto theme to resemble your website.




Getting "Warning: Cannot modify header information" with template - scottyd - 2009-06-16

cool. thanks for the info. i will give that a shot!