Solved

Header Problem

Posted on 2006-06-27
10
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

696 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