Jump to content

[SOLVED] im getting a warning, kind of new to this stuff


Capslock

Recommended Posts

I edited some of the address to protect my project

 

I looked online for answers and all im seeing is "it's because of white spaces" I have checked both my php on the mother page, and on the page to include. I can't find any spaces inside or outside the php that shouldn't be there.

 

This is what im getting..

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/marauder/public_html/trial3/securetop.php:8 ) in /home/marauder/public_html/trial3/securetop.php on line 9

 

Can anyone help? (Had to add the space at the end of the first address, the 8 and ) where creating a smilie)

Link to comment
Share on other sites

session_start(); should always be on the first line after <?php or on the second like after <?php

e.g.

<?php
session_start();
?>

 

This is a fallacy. session_start() can go anywhere, it just must be prior to output being sent.

Link to comment
Share on other sites

There's a reason why it happened.

 

 

The HTTP protocol's basic layout is:

 

 

 

HEADERS HERE

 

CONTENT HERE

 

 

So if content has already been sent to the client, how is it possible to go back and send a header?  (session_start() sends a cookie header, since cookies are how clients are ID'd with sessions.)

 

 

It's not just some weird problem people get, like it sounds like y'all are making it out to be.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.