PHP Simplicity Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Some of SFU features: Universal password protection, notification of uploads and logging just to name few.

Author Topic: session_start warnings in standalone SoU  (Read 1565 times)

0 Members and 1 Guest are viewing this topic.

bonaventura

  • Guest
session_start warnings in standalone SoU
« on: November 30, 2009, 09:32:22 AM »

Hiya,

I receive the following errors when accessing the SoU upload script:
Code: [Select]
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /is/htdocs/yadda_yaddaU/www/upload/SFUConfig.php:227) in /is/htdocs/yadda_yadda/www/upload/upload.php on line 68

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /is/htdocs/yadda_yadda/www/upload/SFUConfig.php:227) in /is/htdocs/yadda_yadda/www/upload/upload.php on line 68

Now, I read the FAQ, plus some other threads on this forum and the PHP site, so I know what this means and why it happens.
But the real puzzling problem is that I did not integrate SoU into any own scripts; it is run completely standalone and out-of-the-box, as it were. I only customized it in SFUConfig.

I looked at the offending lines in the two scripts but could not figure out a way to prioritize the session_start command.
Would be very grateful indeed if someone could point me to a way to fix this. Thank you.
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: session_start warnings in standalone SoU
« Reply #1 on: December 06, 2009, 05:22:30 AM »

Could you post the two lines here? Can't help you without seeing them.
Logged

We don't need a reason to help people

bonaventura

  • Guest
Re: session_start warnings in standalone SoU
« Reply #2 on: December 07, 2009, 02:28:48 PM »

By "offending lines" I meant the lines specified in the error messages, which are:
SFUConfig.php: 227
upload.php: 68

Since, as I said, I did not alter the source code at all, those lines should be the same as in the original files distributed by you.
Here's what I get when I open those files in a PHP editor:

SFUConfig 227:
Quote
<p align="center" class="header">'.SCRIPT.'</p>';

upload 66-68:
Quote
//password protection area..
if (SFU_PROTECT == true) {
   session_start();



Here are the error message again (because they are tiny and hard to read when in between code tags):
Quote
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /is/htdocs/yadda_yaddaU/www/upload/SFUConfig.php:227) in /is/htdocs/yadda_yadda/www/upload/upload.php on line 68

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /is/htdocs/yadda_yadda/www/upload/SFUConfig.php:227) in /is/htdocs/yadda_yadda/www/upload/upload.php on line 68
Logged

Kingu

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
Re: session_start warnings in standalone SoU
« Reply #3 on: December 22, 2009, 10:13:10 AM »

To fix this problem, make a small change in upload.php

Line 68, named: session_start();
should be moved to:
Line 64, on the line before html_header();

Not sure what this will do for non-password protected setups, but it works if you are password protecting the uploader.

That area should look like this:
Code: [Select]
//start the HTML formation
session_start();
html_header();

//password protection area..
if (SFU_PROTECT == true) {
   
   if (isset($_POST['SFU_Protect'])) {
Logged

bonaventura

  • Guest
Re: session_start warnings in standalone SoU
« Reply #4 on: December 22, 2009, 05:55:08 PM »

Thank you very much indeed.
Logged
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What is the answer to one plus one? (in numbers):