473,769 Members | 6,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Common session_start() error..

I am getting the error message below when ever I try to start my script
on two different servers. I am not getting any errors off of my PC. I
have looked around and found the answer a simple one. I can not stop the
error in my script. The session_start() is the first thing that happens
before any Headers are created. Any one have any suggestions. Include
the start of the code that uses the session var.
Warning: session_start() : Cannot send session cookie - headers already
sent by (output started at
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php:1) in
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php on line 8

Warning: session_start() : Cannot send session cache limiter - headers
already sent (output started at
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php:1) in
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php on line 8

<?php
/**
*
*
* @version $Id$
* @copyright 2006
*/
session_start() ;
if(!isset($_SES SION['abbr_letter']))
$_SESSION['abbr_letter'] = 'A';

require_once 'includes/config.inc.php' ;
require_once 'includes/header.inc.php' ;
//
// Start a Form
?>
<html>
<head>
<style type="text/css" >
body {
margin-left: 10%; margin-right: 10%;
color: purple;
background-color: #FFFFF2;
}
quote{ background-color: white }
</style>
</head>
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<input type="radio" name="abbr_lett er" value="A" checked="TRUE"
onclick="submit ()"A
<input type="radio" name="abbr_lett er" value="B" onclick="submit ()"B
<input type="radio" name="abbr_lett er" value="C" onclick="submit ()"C
<input type="radio" name="abbr_lett er" value="D" onclick="submit ()"D
<input type="radio" name="abbr_lett er" value="E" onclick="submit ()"E
<input type="radio" name="abbr_lett er" value="F" onclick="submit ()"F
<input type="radio" name="abbr_lett er" value="G" onclick="submit ()"G
<input type="radio" name="abbr_lett er" value="H" onclick="submit ()"H
<input type="radio" name="abbr_lett er" value="I" onclick="submit ()"I
<input type="radio" name="abbr_lett er" value="J" onclick="submit ()"J
<input type="radio" name="abbr_lett er" value="K" onclick="submit ()"K
<input type="radio" name="abbr_lett er" value="L" onclick="submit ()"L
<input type="radio" name="abbr_lett er" value="M"
onclick="submit ()"M <br>
<input type="radio" name="abbr_lett er" value="N" onclick="submit ()"N
<input type="radio" name="abbr_lett er" value="O" onclick="submit ()"O
<input type="radio" name="abbr_lett er" value="P" onclick="submit ()"P
<input type="radio" name="abbr_lett er" value="Q" onclick="submit ()"Q
<input type="radio" name="abbr_lett er" value="R" onclick="submit ()"R
<input type="radio" name="abbr_lett er" value="S" onclick="submit ()"S
<input type="radio" name="abbr_lett er" value="T" onclick="submit ()"T
<input type="radio" name="abbr_lett er" value="U" onclick="submit ()"U
<input type="radio" name="abbr_lett er" value="V" onclick="submit ()"V
<input type="radio" name="abbr_lett er" value="W" onclick="submit ()"W
<input type="radio" name="abbr_lett er" value="X" onclick="submit ()"X
<input type="radio" name="abbr_lett er" value="Y" onclick="submit ()"Y
<input type="radio" name="abbr_lett er" value="Z" onclick="submit ()"Z
<br>
</FORM>
<b><FORM NAME="author" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<SELECT NAME="author_pk " SIZE="20" COLS="10" onclick="submit ()">

<?php
//
//Check for the first time pass
if( !isset($_POST['abbr_letter']) ) {
$_POST['abbr_letter'] = $_SESSION['abbr_letter'];
}
//
//If already set then reset the local Var to the Session
$_SESSION['abbr_letter'] = $_POST['abbr_letter'];
//
//Setup for the database call for authors by first letter
$sqlcmd = $author_detail_ select_by_Lette r . $_POST['abbr_letter']
. $author_detail_ orderBy;

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 6 '06 #1
2 1848
On Sun, 05 Nov 2006 23:17:19 -0500, IchBin <we******@ptd.n etwrote:
>I am getting the error message below when ever I try to start my script
on two different servers. I am not getting any errors off of my PC. I
have looked around and found the answer a simple one. I can not stop the
error in my script. The session_start() is the first thing that happens
before any Headers are created. Any one have any suggestions. Include
the start of the code that uses the session var.

Warning: session_start() : Cannot send session cookie - headers already
sent by (output started at
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php:1) in
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php on line 8

Warning: session_start() : Cannot send session cache limiter - headers
already sent (output started at
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php:1) in
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php on line 8

<?php
Do you really have this indentation in the script before the <?php tag? If so,
that's where the output is coming from - and that's also backed up by the error
saying the output started on line 1.

It's possible to mask these problems by turning on one of the variants of
output_bufferin g, but it's best practice to eliminate the output before any
headers are sent so it works with or without buffering. This may explain why
you see it on one setup but not the other - you probably have buffering (or
zlib output compression) turned on.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 6 '06 #2
Andy Hassall wrote:
On Sun, 05 Nov 2006 23:17:19 -0500, IchBin <we******@ptd.n etwrote:
>I am getting the error message below when ever I try to start my script
on two different servers. I am not getting any errors off of my PC. I
have looked around and found the answer a simple one. I can not stop the
error in my script. The session_start() is the first thing that happens
before any Headers are created. Any one have any suggestions. Include
the start of the code that uses the session var.

Warning: session_start() : Cannot send session cookie - headers already
sent by (output started at
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php:1) in
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php on line 8

Warning: session_start() : Cannot send session cache limiter - headers
already sent (output started at
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php:1) in
/home/www/ichbinquotation s.awardspace.co m/quotes/quotes.php on line 8

<?php

Do you really have this indentation in the script before the <?php tag? If so,
that's where the output is coming from - and that's also backed up by the error
saying the output started on line 1.

It's possible to mask these problems by turning on one of the variants of
output_bufferin g, but it's best practice to eliminate the output before any
headers are sent so it works with or without buffering. This may explain why
you see it on one setup but not the other - you probably have buffering (or
zlib output compression) turned on.
Thanks Andy that was the problem. Sorry, I am new to PHP and I do not
understand why those four spaces would give me a problem. The "output of
what" is coming from where? It looks like I do have zlib output
compression ala phpinfo().

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2899
by: Florence HENRY | last post by:
Hello, I've searched about my problem on google before posting, but I didn't find anything relevant... I have a problem with session_start. Here is my code : <html> <head> <?php session_start();
2
1929
by: Reply-Via-Newsgroup Thanks | last post by:
Folks, I consider myself a reasonably strong PHP programmer, but I've not used sessions before (I've used cookies instead) and I'd appreciate it if someone could confirm something for me. Namely... I'm working on someone else's code who has used sessions - In their main login page, they do not use session_start() but instead, just write directly to the $_SESSION super global array variable. This seems to work - however on some later...
3
2212
by: Trogdor | last post by:
I set up a server on an AMD 650 machine running gentoo linux. I installed Apachie 2, MySQL 4.1 and PHP 4.3.11 I use another computer on my local net (192.168.0.x) to access the server as a client. MySQL works perfectly. I have created and queried databases with no problem. Apachie 2 appears to work with no problem. I can call up web pages in the expected maner.
8
2232
by: lkrubner | last post by:
I was trying to set a cookie before I called session_start() and it was giving me an error. But isn't sessions really just a cookie? Why would it matter if I sent a cookie before session_start? Can I set them afterwards?
4
5916
by: Curious George | last post by:
I have a frameset with multiple aspx pages whithin it. I lauch the page and notice that it triggers many session_start events. In fact I knotice multiple events for the same page. I am also using windows authentication. On a few pages I get guest and then the user who is loged into the computer. I am writing user information to my session and do not want it writen 8 times.
4
6685
by: csn | last post by:
Is it possible to have a Response.Redirect in Global.asax in the Application_Start and Session_Start events? We have code in both events, with try-catch blocks, and if an exception is caught, we wanted to redirect to an error page. But, this doesn't seem to work. So, another question is, if an exception is thrown and caught in a catch block in Application_Start and/or Session_Start, what do we or can we do with it?
19
7928
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php on line 14
6
1965
by: comp.lang.php | last post by:
I am using session_start() on index.php and for some reason sometimes it'll fail. No warnings, no errors, no notices, not even after prepending error_reporting(E_ALL) and ini_set('display_errors', TRUE) before session_start() do I see anything, it just plain dies. I used LiveHTTPHeaders to verify that I am getting a 200 OK response, thus everything seems OK except that it's dying on session_start(). Sometimes.
6
11497
Markus
by: Markus | last post by:
Things to discuss: Headers What are they? What does PHP have to do with headers? Why can they only be sent before any output? Common causes
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.