Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

session variables error message

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

session variables error message

Postby juansoul » Tue Dec 03, 2002 12:02 pm

can anyone tell me why i am getting this error this message when I try to start a session?
Code: Select all
Warning: Cannot send session cookie - headers already sent by (output started at /home/www/bullzeyecreative/CHN/cart.php:86) in /home/www/bullzeyecreative/CHN/cart.php on line 105
[/code]
juansoul
New php-forum User
New php-forum User
 
Posts: 29
Joined: Tue Oct 08, 2002 6:33 pm

Postby Oleg Butuzov » Wed Dec 04, 2002 12:20 am

You are alredy answered at your question =)


Cannot send session cookie - headers already sent by (bla-bla-bla)


Let me guese - are your script looked like this

Code: Select all
<html>
</html>
<?php
//some code
?>
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Re: session variables error message

Postby wiredme » Sun Dec 08, 2002 9:13 pm

juansoul wrote:can anyone tell me why i am getting this error this message when I try to start a session?
Code: Select all
Warning: Cannot send session cookie - headers already sent by (output started at /home/www/bullzeyecreative/CHN/cart.php:86) in /home/www/bullzeyecreative/CHN/cart.php on line 105
[/code]



try this :
<?
#session_start(); if you r using sessions
ob_start();
header ("Pragma: no-cache");

/code here


ob_end_flush();
?>
it occurs because your script is attempting to print something on screen. To avoid that you have to save it into buffers before it will be printed in screen..

Hope it works
:lol:
wiredme
New php-forum User
New php-forum User
 
Posts: 7
Joined: Sun Dec 08, 2002 9:02 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron