Loan - Debt Consolidation - Debt Consolidation - Credit Cards - Debt Consolidation

PDA

View Full Version : Help With A Script


ZaxiHosting
Sep 4th 2007, 6:58 pm
Hello,
Recently I buy a website.
I try to install a clean setup(the same results I had with move too.) But I receive one big error.
When I enter codes,above <?php in the .index.php file,the file "crash" and returns:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/*/public_html/my-sl.net/index.php:4) in /home/*/public_html/my-sl.net/include/session.class.inc.php on line 68

In line4 in index,it is <?php
And in line 68 it is session_start();

What Can I Do?
Thank you

NickD
Sep 4th 2007, 7:01 pm
You cannot start a session after any output has been products, echo, printed ect. You can use output buffering to get around this..

php.net/ob_start
php.net/ob_end_flush

ZaxiHosting
Sep 4th 2007, 7:02 pm
So what can I Do?
I want some ads and title,keywords and description to be before php code start.
Regards

NickD
Sep 4th 2007, 7:05 pm
Make this the very first line of your file:

<?php
ob_start();
?>

Put this at the end of your file:

<?php
ob_end_flush();
?>

nabil_kadimi
Sep 4th 2007, 7:18 pm
A better solution is that you find the "start_session();" and add your code after it.
Or you could simply show us your source code.

ZaxiHosting
Sep 4th 2007, 7:29 pm
@nabil_kadimi
I have tried this before but nothing.
It solved with Nickd solution:)
Thank you both!