Forums

PHP

This topic is locked

Warning: Cannot send session cache limiter - heade

Posted 21 Mar 2004 06:53:34
1
has voted
21 Mar 2004 06:53:34 LiToZ LiToZ posted:
well, i've been putting a piece of PHP code in a new template i had.... and when it is inside the template i get this error [ Warning: Cannot send session cache limiter - headers already sent (output started at F:\Cars SITE\accountedit.php:10) in F:\Cars SITE\accountedit.php on line 31 ] .. and if i removed it from the template it just works fine.. so it is not something wrong with the code i guess ?? well, here is how my page looks like:
[ <HTML dir="rtl">
<HEAD>
<TITLE>.::My CarZ::.</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 bottommargin="0" rightmargin="0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" height="100%" background="/images/back-1.jpg" bgcolor="#2E2E2E" style="background-position:top; background-repeat:repeat-x"> </td>
<td width="15" height="100%" background="/images/back-3.jpg" valign="top"><img src="/images/line-2.jpg" width="15" height="253"></td>
<td valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="620" height="253" valign="top">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="620" height="253">
<param name="movie" value="with_fl/Html/flash/vampire4JULIK.swf">
<param name="quality" value="high"><param name="menu" value="false">
<embed src="with_fl/Html/flash/vampire4JULIK.swf" quality="high" pluginspage="www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="253"></embed>
</object>
</td>
</tr>
<tr>
<td width="620" height="100%">
<table width="620" height="100%" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<TD bgcolor="#CCCCCC"> <p align="center">
<?php
session_start();
include("common.php";
[code
code
code
code]
then the rest of the template....


now. what is really driving me crazy is that i read that the session MUST be placed before any outputs, so i did that modification:



[ <?php
session_start();
?>
<HTML dir="rtl">
<HEAD>
<TITLE>>.::My CarZ::.</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 bottommargin="0" rightmargin="0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" height="100%" background="/images/back-1.jpg" bgcolor="#2E2E2E" style="background-position:top; background-repeat:repeat-x"> </td>
<td width="15" height="100%" background="/images/back-3.jpg" valign="top"><img src="/images/line-2.jpg" width="15" height="253"></td>
<td valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="620" height="253" valign="top">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="620" height="253">
<param name="movie" value="with_fl/Html/flash/vampire4JULIK.swf">
<param name="quality" value="high"><param name="menu" value="false">
<embed src="with_fl/Html/flash/vampire4JULIK.swf" quality="high" pluginspage="www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="253"></embed>
</object>
</td>
</tr>
<tr>
<td width="620" height="100%">
<table width="620" height="100%" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<TD bgcolor="#CCCCCC"> <p align="center">
<?php
include("common.php";
?>
<HTML dir="rtl">
<HEAD>
<TITLE>.::. KSA Used Cars .::. The Biggest Used Cars Store in Kingdom of Saudi Arabia</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 bottommargin="0" rightmargin="0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" height="100%" background="/images/back-1.jpg" bgcolor="#2E2E2E" style="background-position:top; background-repeat:repeat-x"> </td>
<td width="15" height="100%" background="/images/back-3.jpg" valign="top"><img src="/images/line-2.jpg" width="15" height="253"></td>
<td valign="top">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="620" height="253" valign="top">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="620" height="253">
<param name="movie" value="with_fl/Html/flash/vampire4JULIK.swf">
<param name="quality" value="high"><param name="menu" value="false">
<embed src="with_fl/Html/flash/vampire4JULIK.swf" quality="high" pluginspage="www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="620" height="253"></embed>
</object>
</td>
</tr>
<tr>
<td width="620" height="100%">
<table width="620" height="100%" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<TD bgcolor="#CCCCCC"> <p align="center">
<?php
include("common.php";
code
code
code ]
and i got the following error:
Warning: Cannot send session cache limiter - headers already sent (output started at F:\Cars SITE\accountedit.php:1) in F:\Cars SITE\accountedit.php on line 2
.... well it says line TWO, where before line two can i put that code ? <img src=../images/dmxzone/forum/icon_smile_dead.gif border=0 align=middle>

any help please on how to get the code work from inside the new template without getting this error ? thanks in advance <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>


Edited by - AkMaLiTo-C on 21 Mar 2004 07:12:56

Replies

Replied 21 Mar 2004 20:36:55
21 Mar 2004 20:36:55 Phil Shevlin replied:
Any header type code such as sessions needs to be at the top of the page (before any html code).

HTML is being sent to the user before the session code runs -- this is your problem. Just try moving the php to the top.
Replied 21 Mar 2004 23:23:24
21 Mar 2004 23:23:24 LiToZ LiToZ replied:
well i know that and i did put it at the TOP of the page, please check the last part of my previouse post you will find that in my last try i moved the session part to the VERY begining of the page...

==| Running IIS5 - DWMX - Asp VBscript and php 4.0.3- access 2000 DB or MySql for PHP |==
Replied 22 Mar 2004 00:50:38
22 Mar 2004 00:50:38 LiToZ LiToZ replied:
well, i have been messing around with the problem till i knew EXACTLY what is wrong but i still need help in solving it....
well my file HAVE to be encoded in the properties of dwmx to utf-8 cuz i am using arabic language in the file.. and that encoding is read BEFORE teh session_start part !!! so how can i solve it ? cuz i have to encode it that way to be able to use the language...


Edited by - AkMaLiTo-C on 22 Mar 2004 08:45:17

Reply to this topic