Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

My members area

Featured Replies

Hi guys,

 

Have just started implementing a members area in to my site which did previously work when I had it running through my site that I developed in htm/css but now I have integrated wordpress in to my site and basically rebuilt the site, it doesnt seem to want to play.

 

Have created the SQL database and imported the relevant file, but I get the following lines appear at the top of my members page:

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38) in /home/adejones/public_html/wp-content/themes/pcc/members.php on line 38

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38) in /home/adejones/public_html/wp-content/themes/pcc/members.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38) in /home/adejones/public_html/wp-content/themes/pcc/members.php on line 41

 

line 38 is:

<? ob_start(); session_start();include_once"config.php";

and line 41 is:

header("Location: login.php");

 

Config.php is in the same directory but I've just had a thought that I havent actually made the login page yet so will this be the problem? And if not, I have had a couple of problems with wordpress picking up the correct paths so instead of just config.php, do you think it would be worth while trying the full path (http://www...... )

 

I thought i'd make the next page to go with this members area and see how that goes so made the settings page, but this gets the same lines at the top of the page and have noticed a few bits of the php code appear in the middle of the site too.

 

You can see these pages here:

 

http://www.primarycarecommunity.net/members/

http://www.primarycarecommunity.net/settings/

 

I would appreciate any help you can give, thanks.

 

Adey

Hi guys,

 

Have just started implementing a members area in to my site which did previously work when I had it running through my site that I developed in htm/css but now I have integrated wordpress in to my site and basically rebuilt the site, it doesnt seem to want to play.

 

Have created the SQL database and imported the relevant file, but I get the following lines appear at the top of my members page:

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38) in /home/adejones/public_html/wp-content/themes/pcc/members.php on line 38

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38) in /home/adejones/public_html/wp-content/themes/pcc/members.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38) in /home/adejones/public_html/wp-content/themes/pcc/members.php on line 41

 

line 38 is:

<? ob_start(); session_start();include_once"config.php";

and line 41 is:

header("Location: login.php");

 

Config.php is in the same directory but I've just had a thought that I havent actually made the login page yet so will this be the problem? And if not, I have had a couple of problems with wordpress picking up the correct paths so instead of just config.php, do you think it would be worth while trying the full path (http://www...... )

 

I thought i'd make the next page to go with this members area and see how that goes so made the settings page, but this gets the same lines at the top of the page and have noticed a few bits of the php code appear in the middle of the site too.

 

You can see these pages here:

 

http://www.primarycarecommunity.net/members/

http://www.primarycarecommunity.net/settings/

 

I would appreciate any help you can give, thanks.

 

Adey

 

As far as i know, headers cant be sent out if something has been echoed/displayed

 

so i cant do

 

echo "hello";
header("Location: index.php");

 

it would have to be the header line first, so if the header is going to be used, run the PHP functions/script first and then run the necessary headers then echo the content

 

also session_start() is usually on the first line after the opening php tags, so if you want to use sessions, you need to start the session before anything is echoed (and i think it has to go before the rest of the php script too not 100% sure though), so basically put your session_start(); at the very top of the php file after the <?php line

 

<?php
session_start();
//rest of code below

  • Author

I think I may have cracked it, there was already a <?php at the top from wordpress because its a page template so just jiggled where it opens/closes and now its redirecting me to login.php (which I havent made yet) because i'm not logged in...

Now just to make the other pages and see if it will go from there...

output started at /home/adejones/public_html/wp-content/themes/pcc/members.php:38

 

take a look what's inside that file, its sending your headers/echoing.

 

anyhow, think about separating the business logic and the view part of your application, then you wouldnt have such problems :p

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.