php sessions, different problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
excultus
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 9:29 am

php sessions, different problem

Post by excultus »

Hi guys!
I have a problem with php sessions, I always get the

Code: Select all

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at index.php:1) in /.....index.php on line 10

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /..../index.php on line 10
warning.
And I do NOT have blank space in the begining of the file as it works perfectlz on my php instalation at home but when I upload to the server I get this...
Headers are obviouslz sent but I dont know where...
This is the incriminated piece of code

Code: Select all

<?php
  
  // define debug level, 0 for no debugging, 1 for debugging enabled
	define("DEBUG", 0);
	
  // insert required scripts/libaries
  require_once("libs/smarty/Smarty.class.php");
  require_once("config.php");
  
  session_start();
help me please :cry:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Do you use an editor that sets a BOM?
excultus
Forum Newbie
Posts: 5
Joined: Fri Jul 28, 2006 9:29 am

Post by excultus »

ahh looks as I am...
I use PSPad and saving the file to UTF-8.. is there any way I could go on using UTF-8 and not getting the warnings? to continue using UTF-8 but not inserting the leading char?

You helped me much, thanks!!
Post Reply