Solved

Header Problem

Posted on 2006-06-27
10
294 Views
Last Modified: 2013-12-12
Hi everyone I have a very strange problem.I'm constantly reciveing same error

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php:1) in /var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php:1) in /var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php on line 2

and here is my code(first 20 lines of them cause I supose that is all that You people need)

<?
      session_start();
      require_once("conf/db_connection.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Add/Remove Subscribers :: Select a method for adding/removing subscribers</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="css/mainStyle.css" type=text/css rel=STYLESHEET>
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY bottomMargin=0 bgColor=#cddcec leftMargin=0 topMargin=0 rightMargin=0
marginheight="0" marginwidth="0"><IMG height=10
src="images/_space.gif"
width=1 border=0><BR>
<TABLE cellSpacing=0 cellPadding=0 width=770 align=center bgColor=#062f68
border=0>
  <TBODY>
  <TR>...........

Can anybody tell me why it is happening.Thanks in advance...
0
Comment
Question by:cstormer
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 16995107
You probably have some whitespace (a space, new line, anything at all) before that first <?.  Remove it.
0
 

Author Comment

by:cstormer
ID: 16995177
Man that will be too much easy.That wasn't a problem.I also have used ob_start() directive but it wasn't much halp also....So if someone have anyother idea please help....
0
 
LVL 20

Expert Comment

by:Muhammad Wasif
ID: 16995225
Are you using non-english characters in add_subscribers.php?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:cstormer
ID: 16995371
not as I know.But if that's a case what is the solution?
0
 
LVL 4

Expert Comment

by:ale_jrb
ID: 16996437
If you are trying to use any header redirect commands after anything, remove them - it won't work and will result in this error.

For further reading about this error, see here:
http://www.phpfreaks.com/forums/index.php?showtopic=37442
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 16999083
I used ethereal to see the EXACT output ...

HTTP/1.1 200 OK
Connection: close
Proxy-Connection: close
Date: Wed, 28 Jun 2006 07:20:55 GMT
Content-Type: text/html; charset=UTF-8
Server: Apache/2.0.52 (Red Hat)
X-Powered-By: PHP/4.3.9

...<br />
<b>Warning</b>:  session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php:1) in <b>/var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php</b> on line <b>2</b><br />
<br />
<b>Warning</b>:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php:1) in <b>/var/www/versatables.com/admins/testing/campaign_manager/manage_subscribers/add_subscribers.php</b> on line <b>2</b><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


The ... seems to be the issue.

What is interesting is that this does NOT appear in the view-source.

Can you create the following PHP file.

<?php
session_start();
phpinfo();
?>

Run that and see if you have the same problem.
0
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 500 total points
ID: 16999125
In looking further into the ethereal output, the characters are not dots but 0xEF 0xBB 0xBF or \357\273\277

Which has lost me!

I wonder if you've somewhere got some sort of compression going on.

I know that if you use zlib compression on the server, you can't use it within PHP also (double compression wouldn't be decoded correctly at the client).

0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 16999969
What was the issue?
0
 
LVL 20

Expert Comment

by:Muhammad Wasif
ID: 17000008
To RQuadling,

What is ethereal?
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 17000124
Easiest way ...

http://www.ethereal.com

"Ethereal® is used by network professionals around the world for troubleshooting, analysis, software and protocol development, and education. It has all of the standard features you would expect in a protocol analyzer, and several features not seen in any other product. Its open source license allows talented experts in the networking community to add enhancements. It runs on all popular computing platforms, including Unix, Linux, and Windows."
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question