Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
session_start(); Error
Old 11-04-2007, 09:53 AM session_start(); Error
Average Talker

Posts: 16
Name: Mark Masterson
Location: Long Island, New York
Trades: 0
I know this is all around the internet but I did everything I could and it still gives me this error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/d/a/r/BLAH/html/XSVG/System Files/Nav.cf:8) in /home/content/d/a/r/BLAH/html/XSVG/Admin/Files/Auth.php on line 4


The code is...

Nav.cf
PHP Code:
<htmL>
<
br>
<
center><a href="Main.php">Home</a> | 
<
a href="Main.php?Page=CrtShw">Add A Show</a> | 
<
a href="Main.php?Page=UpldEp">Upload Episode</a> | 
<
a href="Main.php?Page=BugRpt">Bug Report</a> | 
<
a href="Main.php?Page=Logout">Logout</a><br>
<
a>Welcome To BETA Testing!| Version =</a
and...

Auth.php
PHP Code:
<?
include '/home/content/d/a/r/BLAH/html/XSVG/System Files/Config.php';
if ( 
$_POST["psswrd"] == $Password ) {
session_start(); 
$_SESSION['views'] = 1;
    include 
'/home/content/d/a/r/BLAH/html/XSVG/System Files/Config.php';
    include 
'/home/content/d/a/r/BLAH/html/XSVG/System Files/SysInfo.php';
    include 
'/home/content/d/a/r/BLAH/html/XSVG/System Files/Nav.php';

}else{
    echo 
"Wrong Password";
    echo 
$_POST["psswrd"];
}
?>
People tell me to move the session_start(); but if I do the code wont work as its suppose to. Can someone PLEASE help I spent over 2 hours on this one little error!
__________________
Mark Masterson
MMasterson is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-04-2007, 12:06 PM Re: session_start(); Error
Novice Talker

Posts: 5
Name: Krzysztof Lechowski
Trades: 0
I'd move session_start to the beggining of the script, just after <? .
Besides make sure, there's no BOM in the beggining of the script.
Morover, you can read about ob_start() and ob_end_flush() and try it.
Regards
chrisno1 is offline
Reply With Quote
View Public Profile
 
Old 11-04-2007, 12:43 PM Re: session_start(); Error
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Put the session_start(); at the beginning of the page. If you echo/send any HTML to the page you cannot set the session cookie.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 11-04-2007, 04:59 PM Re: session_start(); Error
Raulică's Avatar
Ultra Talker

Posts: 253
Location: Constanta,Romania
Trades: 0
As rogem002 stated, you need to put session_start before anything in order to send the cookies information in the headers. Otherwise the browser cannot get the cookies information.
__________________

Please login or register to view this content. Registration is FREE

Professional hosting for all pockets!

Please login or register to view this content. Registration is FREE
Raulică is offline
Reply With Quote
View Public Profile Visit Raulică's homepage!
 
Old 11-04-2007, 08:09 PM Re: session_start(); Error
Average Talker

Posts: 16
Name: Mark Masterson
Location: Long Island, New York
Trades: 0
Hey thanks a lot! What I didn't do before was I didn't bring it to the top of Main.php page. Main.php page has a php switch and Auth.php was in that switch so as soon as i put the session start on the top of Main.php it worked. Thanks a lot!


-Mark R. Masterson
__________________
Mark Masterson
MMasterson is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to session_start(); Error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.34380 seconds with 12 queries