Getting "Warning: Cannot modify header information" with template

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

`
<?php
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
?>
`
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!

Comments

  • Very likely you have some whitespace befor or after the PHP section. That is before `<?php` or after `?>`
  • 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?
  • Where have you placed the above code? It needs to be the first thing in your file.
  • 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?
  • 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.
  • cool. thanks for the info. i will give that a shot!
Sign In or Register to comment.