473,659 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unexpected Absence of Expected Warning.

Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php

function Intelli()
{
echo"Hello P";
}

function Bitz()
{
echo"Hello MySQL";
}

;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';

$myFunc();
print'header';

session_start() ;
setcookie('user id')
?>

----------------------------------------------------------------
The following is the output i got.
There is no warning

[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html

Hello Pheader
-------------------------------------------------------------

can any one explain why i din get the warning.....

Also please refer the following link,

http://groups.google.com/group/php.g...178a7922fbc912

thanks

Apr 25 '07 #1
6 2160
"geevaa" <go*********@gm ail.comwrote in message
news:11******** **************@ n35g2000prd.goo glegroups.com.. .
Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php

function Intelli()
{
echo"Hello P";
}

function Bitz()
{
echo"Hello MySQL";
}

;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';

$myFunc();
print'header';

session_start() ;
setcookie('user id')
?>

----------------------------------------------------------------
The following is the output i got.
There is no warning

[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html

Hello Pheader
-------------------------------------------------------------

can any one explain why i din get the warning.....

Output buffering on by default?

echo ini_get('output _buffering');
--
Ra*********@gma il.com

"Good tea. Nice house." -- Worf
Apr 25 '07 #2
On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message

news:11******** **************@ n35g2000prd.goo glegroups.com.. .
Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php
function Intelli()
{
echo"Hello P";
}
function Bitz()
{
echo"Hello MySQL";
}
;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';
$myFunc();
print'header';
session_start() ;
setcookie('user id')
?>
----------------------------------------------------------------
The following is the output i got.
There is no warning
[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html
Hello Pheader
-------------------------------------------------------------
can any one explain why i din get the warning.....

Output buffering on by default?

echo ini_get('output _buffering');

--
Rami.Elo...@gma il.com

"Good tea. Nice house." -- Worf
my php coding is

<?php

echo ini_get('output _buffering');

?>

My output is

[tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
X-Powered-By: PHP/5.2.0
Content-type: text/html

4096

thanks

May 2 '07 #3
"geevaa" <go*********@gm ail.comwrote in message
news:11******** **************@ h2g2000hsg.goog legroups.com...
On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
>"geevaa" <govivasa...@gm ail.comwrote in message

news:11******* *************** @n35g2000prd.go oglegroups.com. ..
Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php
function Intelli()
{
echo"Hello P";
}
function Bitz()
{
echo"Hello MySQL";
}
;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';
$myFunc();
print'header';
session_start() ;
setcookie('user id')
?>
----------------------------------------------------------------
The following is the output i got.
There is no warning
[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html
Hello Pheader
-------------------------------------------------------------
can any one explain why i din get the warning.....

Output buffering on by default?

echo ini_get('output _buffering');

--
Rami.Elo...@gm ail.com

"Good tea. Nice house." -- Worf
my php coding is

<?php

echo ini_get('output _buffering');

?>

My output is

[tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
X-Powered-By: PHP/5.2.0
Content-type: text/html

4096

Well it's on then, since it returns the buffer size. The body, ie. output is
sent only when the script exits so that's why you get no warning.

--
Ra*********@gma il.com

"Good tea. Nice house." -- Worf
May 2 '07 #4
On May 2, 11:13 am, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message

news:11******** **************@ h2g2000hsg.goog legroups.com...
On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message
>news:11******* *************** @n35g2000prd.go oglegroups.com. ..
Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php
function Intelli()
{
echo"Hello P";
}
function Bitz()
{
echo"Hello MySQL";
}
;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';
$myFunc();
print'header';
session_start() ;
setcookie('user id')
?>
----------------------------------------------------------------
The following is the output i got.
There is no warning
[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html
Hello Pheader
-------------------------------------------------------------
can any one explain why i din get the warning.....
Output buffering on by default?
echo ini_get('output _buffering');
--
Rami.Elo...@gma il.com
"Good tea. Nice house." -- Worf
my php coding is
<?php
echo ini_get('output _buffering');
?>
My output is
[tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
X-Powered-By: PHP/5.2.0
Content-type: text/html
4096

Well it's on then, since it returns the buffer size. The body, ie. output is
sent only when the script exits so that's why you get no warning.

--
Rami.Elo...@gma il.com

"Good tea. Nice house." -- Worf
Dear rami,

you wan me to use ini_set() to off it. ?
you wan me to make some changes in php.ini ?

May 2 '07 #5
"geevaa" <go*********@gm ail.comwrote in message
news:11******** **************@ o5g2000hsb.goog legroups.com...
On May 2, 11:13 am, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
>"geevaa" <govivasa...@gm ail.comwrote in message

news:11******* *************** @h2g2000hsg.goo glegroups.com.. .
On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message
>>news:11****** *************** *@n35g2000prd.g ooglegroups.com ...
Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php
function Intelli()
{
echo"Hello P";
}
function Bitz()
{
echo"Hello MySQL";
}
;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';
$myFunc();
print'header';
session_start() ;
setcookie('user id')
?>
----------------------------------------------------------------
The following is the output i got.
There is no warning
[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html
Hello Pheader
-------------------------------------------------------------
can any one explain why i din get the warning.....
>Output buffering on by default?
>echo ini_get('output _buffering');
>--
Rami.Elo...@gm ail.com
>"Good tea. Nice house." -- Worf
my php coding is
<?php
echo ini_get('output _buffering');
?>
My output is
[tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
X-Powered-By: PHP/5.2.0
Content-type: text/html
4096

Well it's on then, since it returns the buffer size. The body, ie. output
is
sent only when the script exits so that's why you get no warning.

--
Rami.Elo...@gm ail.com

"Good tea. Nice house." -- Worf

Dear rami,

you wan me to use ini_set() to off it. ?
you wan me to make some changes in php.ini ?
I'm not telling you to do anything. You wondered why there was no error
message, and the reason is that your php is configured to buffer output.
It's up to you to decide what to do with this information.

--
Ra*********@gma il.com

"Good tea. Nice house." -- Worf
May 2 '07 #6
On May 2, 1:06 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message

news:11******** **************@ o5g2000hsb.goog legroups.com...
On May 2, 11:13 am, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message
>news:11******* *************** @h2g2000hsg.goo glegroups.com.. .
On Apr 25, 12:21 pm, "Rami Elomaa" <rami.elo...@gm ail.comwrote:
"geevaa" <govivasa...@gm ail.comwrote in message
>news:11******* *************** @n35g2000prd.go oglegroups.com. ..
Hi Group,
The page 167 of book Learning PHP5 by David Sklar says that
setcookie() and session_start() must be added before any output.
I tried to use that functions at last line but no warning!.
The warning which i got 1 month back is not issued now.
------------------------------------------------------------------
The following is my PHP program
<?php
function Intelli()
{
echo"Hello P";
}
function Bitz()
{
echo"Hello MySQL";
}
;
$a = 1;
if($a)
$myFunc = 'Intelli';
else
$myFunc ='Bitz';
$myFunc();
print'header';
session_start() ;
setcookie('user id')
?>
----------------------------------------------------------------
The following is the output i got.
There is no warning
[tdphpadmin@trgb ws40 ~/public_html/demo]$ php dynamicfun.php
X-Powered-By: PHP/5.2.0
Set-Cookie: ZDEDebuggerPres ent=php,phtml,p hp3; path=/
Set-Cookie: PHPSESSID=bp1m1 7rlrgsa5g19tfek idov31; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-
check=0
Pragma: no-cache
Set-Cookie: userid=
Content-type: text/html
Hello Pheader
-------------------------------------------------------------
can any one explain why i din get the warning.....
Output buffering on by default?
echo ini_get('output _buffering');
--
Rami.Elo...@gma il.com
"Good tea. Nice house." -- Worf
my php coding is
<?php
echo ini_get('output _buffering');
?>
My output is
[tdphpadmin@sysa ws40 ~/public_html/php]$ php inigetoutputbuf fering.php
X-Powered-By: PHP/5.2.0
Content-type: text/html
4096
Well it's on then, since it returns the buffer size. The body, ie. output
is
sent only when the script exits so that's why you get no warning.
--
Rami.Elo...@gma il.com
"Good tea. Nice house." -- Worf
Dear rami,
you wan me to use ini_set() to off it. ?
you wan me to make some changes in php.ini ?

I'm not telling you to do anything. You wondered why there was no error
message, and the reason is that your php is configured to buffer output.
It's up to you to decide what to do with this information.

--
Rami.Elo...@gma il.com

"Good tea. Nice house." -- Worf
Dear Rami,

Thanks for your explanation

I am now working on how to set the output_bufferin g to the default
value of 0.
May 2 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1348
by: Grzegorz Dostatni | last post by:
Consider the following fragment: >>> for i in ('a','b','c'): .... for i in (1,2,3): .... print i, .... print i, .... 1 2 3 3 1 2 3 3 1 2 3 3 Now. I believe I know what is happening. The i in both loops refers to the
3
2850
by: Teddy | last post by:
Hello all According to "Think in C++ Volume2", the code below should run smoothly: #include <iostream> #include <exception> using namespace std; class ex { };
6
3178
by: Cro | last post by:
Dear Access Developers, The 'Allow Additions' property of my form is causing unexpected results. I am developing a form that has its 'Default View' property set to 'Continuous Forms' and am displaying records that match an SQL statement entered in the 'Record Source' property of the form. The form behaves correctly and displays the records as expected. The
9
320
by: Roal Zanazzi | last post by:
Hi everyone, I've accidentally found something in my C++ code that is definitively weird. It is obviously an error in my code, but it is not signalled by Microsoft Visual C++ 2005 compiler, not even with a warning. While Borland TurboC++ 2006 compiler stop at it as an error (E2034 Cannot convert 'bool' to 'int *'). // Code start here //
4
1489
by: alacrite | last post by:
#include <iostream> #include <vector> using namespace std; int binarySearch(vector<int>, int, int, int); int main() { vector<intarrInt;
2
2064
by: Dimitri Furman | last post by:
SQL Server 2000 SP4. Running the script below prints 'Unexpected': ----------------------------- DECLARE @String AS varchar(1) SELECT @String = 'z' IF @String LIKE ''
0
356
by: geevaa | last post by:
Hi Group, The page 167 of book Learning PHP5 by David Sklar says that setcookie() and session_start() must be added before any output. I tried to use that functions at last line but no warning!. The warning which i got 1 month back is not issued now. ------------------------------------------------------------------ The following is my PHP program <?php function Intelli()
2
2060
by: geevaa | last post by:
Hi Group, The page 167 of book Learning PHP5 by David Sklar says that setcookie() and session_start() must be added before any output. I tried to use that functions at last line but no warning!. The warning which i got 1 month back is not issued now. ------------------------------------------------------------------ The following is my PHP program <?php function Intelli()
13
3598
by: bintom | last post by:
I ran the following simple code in C++ and got unexpected results: float f = 139.4; cout << f; Output: 139.399994;
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.