Solved

Header Problem

Posted on 2006-06-27
10
292 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 40

Expert Comment

by:RQuadling
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:
RQuadling 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:RQuadling
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:RQuadling
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

863 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now