Jump to content

"Cannot send session cache limiter - headers already sent"

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
mgorgone

mgorgone

    Newbie

  • Members
  • Pip
  • 2 posts
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


#2
mgorgone

mgorgone

    Newbie

  • Members
  • Pip
  • 2 posts
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

#3
dacio

dacio

    Newbie

  • Members
  • Pip
  • 1 posts
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