Hi!
So far:
I installed Gallery2, embedded it in my website by using index.php?site=gallery.
everything works fine, EXEPT: while trying to login to admin or to register, an error appears:
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/polencup/exec/index.php:53) in /www/htdocs/polencup/exec/gallery/modules/core/classes/GalleryPhpVm.class on line 124
the folder g2data runs with chmod 777 and I cleared the Gallery cache so far. nothing happend.
everything else works, you are albe to watch the album, login screen can be displayed, exept the login itsself does not work.
I checked the path, and at the end of the path (on login) there seems something missing like: &g2_navId=xxxxxxx
if I add it, I CAN LOGIN!
so whats wrong?
pls help!
Posts: 32509
do not output / print any HTML before you call GalleryEmbed::handleRequest
Posts: 8
GalleryEmbed::handleRequest ??
where do I find that?
I linked the gallery to an include to gallery2embedded.php
Posts: 32509
what's gallery2embedded.php ?
if you include that, then don't output anything before you include gallery2embedded.php
Posts: 8
I haven't, guess..
I only included the gallery2embedded.php without putting any html before it.
check out youself here
I got gallery2embedded.php
from here
Posts: 32509
please attach a zip file with
- your gallery2embedded.php
- your file that includes gallery2embedded.php
common mistakes:
- empty lines/spaces before <?php / after ?>
- you have html before you include gallery2embedded.php / you have html / output something before calling Gallery::handleRequest (which is done in gallery2embedded.php)
Posts: 8
okay thx for your help, it put the 2 files into a zip-file here
Posts: 32509
gallery.php has a newline after ?> . remove it.
gallery2embedded.php has 2 empty newlines before <?php at the beginning. that's the problem. remove them. the file should start with <?php, no lines before allowed.
same at the end. put the ?> at the beginning of the line and remove the lines after ?>
Posts: 8
thx valiant for your help!
I followed your instruction, I deleted all empty lines as you said, but it didn't fix the problem.
The error keeps appearing
Posts: 32509
maybe consider using an existing integration or just customize the theme instead of trying to integrate g2 yourself...
i really can't write the integration for you and the
Warning: Cannot modify header information - headers already sent by ...
error is very basic in php. it even tells you at which line the output started. so it shouldn't be too hard to debug.
Posts: 8
okay I try to solve it myself by checking exec/index.php:53
hope I find it ..
however, thx for your help!
Posts: 8
I just cannot find the mistake!!
pls help!! here's my index.php , could anyone check it?
please ;(
Posts: 32509
elseif($site == news)
you'll have to put "news" , "gallery", .. into quotation marks! same for all strings
e.g.
elseif($site == 'gallery')
instead of
elseif($site == gallery)
also, you do $include = ...
and not include(...);
-> you don't include the file there.
and, right after the if elseif, ... thing, you do:
elseif($site == addnews) { $include = "content/home/news/addnews.php"; $tip = ""; $rightinfo = "content/home/rightinfo.php"; } ?> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <style> a:link.menuso right after ?> you start outputting html to the browser. and you don't include the files before...
Posts: 8
well I need html to output my buttons which link to my gellery, don't I?