A site I'm working on posts photo galleries from past events. They want users to subscribe to a newsletter to access these photo galleries.
I'm currently using the following code in the very beginning of the header.php:
<?php session_start();
//session_destroy(); ?>
Using this code loads the website properly, except that the following is returned at the beginning of the source on two webpages, along with broken background images:
<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]:
Cannot send session cache limiter - headers already sent (output started at /home/.../the-calendar.php:7)
in <b>/home/.../header.php</b> on line <b>2</b><br />
I want this session to trigger on the photo gallery page only, although I've been led to believe that the session_start() tag should included in the overarching header.php of the WordPress site.
The session php is the very first line of the header, which is the correct place, I believe.
I've tried inserting- is_page('photo-gallery') - into the session php, but this is not successfully implementing; I suspect I'm using the code incorrectly, and would really appreciate help!
Somehow this improper php implementation is causing the background images on two of the site's webpages to break and not display.
Please and thank you!
I appreciate the responses; I looked over that other thread extensively before posting here, and feel that the variation of attempting to trigger the session on certain pages only warranted asking a new question.
Regarding the questions about something else being called before the session start - I've included the first lines of the relevant header just below this, which demonstrates that there is no content being called before the session (at least to my understanding):
<?php session_start();
//session_destroy(); ?>
<!DOCTYPE HTML>
<html prefix="og: http://ogp.me/ns#">
<head>
Somehow the warning HTML message included above only displays on two certain webpages (pages unspecified in the session tag and pages I DON'T need the session on) out of about 20. On these two webpages, the background images are also broken, which I believe to be a direct cause of this overall issue.