Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

"Cannot send session cache limiter - headers already sent"

header session cache

  • Please log in to reply
2 replies to this topic

#1 mgorgone

mgorgone

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 06 May 2008 - 12:11 PM

Hi All,

I've been trying to figure this one out and everything on the web
points to "whitespace" being sent to the browser before the call to
session_start(); So here's my problem. I have two PHP pages,
searchresults.php and shoppingcart.php. The searchresults.php page
doesn't have any problems and runs fine. The shoppingcart.php page is
where I get the "Cannot send..." error. However, I created the
shoppingcart.php FROM the searchresults.php page which is, as I said
before, working without error. Both pages have calls to "echo" so I
just don't get why I'm having an issue with the shoppingcart.php page
when the page it was created from (searchresults.php) doesn't have any
problems.

The tops of the pages are identical as shown below:

searchresults.php
====

<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/movieposters.css" rel="stylesheet" type="text/css" />
<link href="css/navigation.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript" src="js/validation.js"></script>
<title>Buy Movie Posters</title>
</head>
<body>

====

shoppingcart.php
====

<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/movieposters.css" rel="stylesheet" type="text/css" />
<link href="css/navigation.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript" src="js/validation.js"></script>
<title>Buy Movie Posters</title>
</head>
<body>

====

Thanks in advance for any help you can offer.

Cheers,

Mike

Edited by Jordan, 06 May 2008 - 01:26 PM.
Added code tags

  • 0

#2 mgorgone

mgorgone

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 06 May 2008 - 01:10 PM

I figured it out from a post I found elsewhere:

http://www.pragmattica.net/node/10

For my files that weren't working they were saved with the encoding set to UTF-8 and not ANSI. Once I saved the .php files as ANSI they started working.

Cheers,

Mike
  • 0

#3 dacio

dacio

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 01 November 2009 - 01:48 PM

I did had exactly same problem with two files, one of them worked, other had error.

Thanks mgorgone, i tried to find solution for a whole day, your adwise worked for me also.

thanks in a million

cheers
:thumbup:

damjan, slovenia
  • 0





Also tagged with one or more of these keywords: header, session, cache

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download