Header Problem

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...
cstormerAsked:
Who is Participating?
 
Richard QuadlingConnect With a Mentor Senior Software DeveloperCommented:
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
 
snoyes_jwCommented:
You probably have some whitespace (a space, new line, anything at all) before that first <?.  Remove it.
0
 
cstormerAuthor Commented:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Muhammad WasifCommented:
Are you using non-english characters in add_subscribers.php?
0
 
cstormerAuthor Commented:
not as I know.But if that's a case what is the solution?
0
 
ale_jrbCommented:
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
 
Richard QuadlingSenior Software DeveloperCommented:
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
 
Richard QuadlingSenior Software DeveloperCommented:
What was the issue?
0
 
Muhammad WasifCommented:
To RQuadling,

What is ethereal?
0
 
Richard QuadlingSenior Software DeveloperCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.