Hi,
I'm trying to use some of the zenphoto functions on my web site.
Unfortunately, I may have made some mistakes in my code.
I actually have the following errors :
Warning: Cannot modify header information - headers already sent by (output started at /.../accueil.php:2) in /.../galeries/zp-core/functions.php on line 1551
I include the zenphoto functions using this code :
if (!defined('WEBPATH')) define('WEBPATH', 'galeries/');
require_once(WEBPATH . "/zp-core/folder-definitions.php");
require_once(WEBPATH . ZENFOLDER . "/template-functions.php");
Thanks in advance for helping me.
Comments
The other source of this error is when you have a "blank" line in your script before (or after) the <?php....?> section.
I tried to place those lines at the beginning of my page :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<?php
if (!defined('WEBPATH')) define('WEBPATH', 'galeries/');
require_once(WEBPATH . "/zp-core/folder-definitions.php");
require_once(WEBPATH . ZENFOLDER . "/template-functions.php");
$_page = "accueil";
?>
Without any blank space before or after the <?php ... ?>
And I still have the same warnings.
Do you have any other idea ?
Thanks for spending time with my issues.
It's my personal website that I develop by my own.
I may make a mistake somewhere.
If you like to see :
http://www.matthieurieux.com
Don't know what you are planning but maybe doing the site entirely with Zenphoto and the Zenpage plugin would also be an option.
<?php
if (!defined('WEBPATH')) define('WEBPATH', 'galeries/');
require_once(WEBPATH . "/zp-core/folder-definitions.php");
require_once(WEBPATH . ZENFOLDER . "/template-functions.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
</head>
<body>
</body>
</html>
And the warnings still appear.
Nevertheless, I thought that was the way to call the zenphoto functions.
Can you confirm ?
Thanks for helping me
http://www.zenphoto.org/2009/12/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/
However, this is nothing we really test frequently as Zenphoto is meant as a standalone script.
What is the message for the second test? Maybe you still have a blank line or something prior to those lines of PHP code.
I've made again the test #2.
And I have exactly the same error :
Warning: Cannot modify header information - headers already sent by (output started at ... /accueil.php:2) in ... zp-core/functions.php on line 1551
Furthermore, I don't have any extra blank line.
Thanks again.
You need to fix accueil.php line 2.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">
<?php
define('WEBPATH', 'galeries');
require_once(WEBPATH . "/zp-core/template-functions.php");
$_page = "accueil";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Matthieu Rieux - Accueil</title>
<meta http-equiv="Content-Type" content="text/html; charset=UFT-8" />
<!--<meta http-equiv="Content-Type" content="text/html; charset=UFT-8" />-->
<link rel="stylesheet" type="text/css" media="screen, projection" href="/css/master_photos.css" />
</head>
<body class="photos">
<!-- Le corps du site est en fait un tableau de 1 ligne 1 colonne , il est noir et encadré de gris sur un fond (body) un peu plus clair -->
<table id="tab_corps">
<tr><td>
<!-- Le haut de la page -->
<?php include($obj = "./hautpage/hautpage.php"); ?>
<div id="contenu">
<div class="albums">
<p id="arbo">ACCUEIL</p>
<?php if (getOption('Allow_search')) { printSearchForm(''); } ?>
</div>
</div>
<!-- Le contenu de la page -->
<?php include ('./galeries/themes/MatthRieux/moment.php'); ?>
<!-- Le pied de page -->
<?php include ('./piedpage/footer.php'); ?>
</tr></td>
</table>
</body>
</html>
Again, many thanks for your help.
So, I've tried without the first line.
Without success.
Since you don't use another CMS you could do these pages as Zenphoto custom pages as well (or even using the Zenpage plugin) and then you would not need to include Zenphoto functions at all. See the theming tutorial maybe.
Also Safari reports a file not found on "http://www.matthieurieux.com/img/banniere.jpg"
You're right.
That's not my job actually.
Thanks for your patience.
On the server, there is an error.log file with (for example) :
[19-Jul-2010 18:13:15] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/matthie1/public_html/materiel.php:2) in /home/matthie1/public_html/galeries/zp-core/functions.php on line 1551
That's all the information I have.
I think from this conversation that your skills with PHP are probably not sufficient for you to be successful with this project. Certainly you cannot expect us to do your task for you. "that's not OUR job actually"
I don't expect you to do my tasks.
Even if you have understood the contrary.
I'm sorry for that (English is not my native language)
Thanks for your help and your reactivity.
I appreciate.
I'll try to find out what are the php reasons that make the output at line 2.
(I agree with you, I'm not familiar enough with php and html).
Matthieu
PS : the acrylian's post has been edited while creating mine, so responses to his questions don't make any sense now, that could explain our misunderstanding.