473,657 Members | 2,351 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.....

Apr 30 '07 #1
2 2059
geevaa wrote:
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.....
Hi,

one possibility could be activated output buffering. Check the setting
of output_bufferin g in current settings.
Hint <http://de.php.net/manual/en/ref.outcontrol. php>

hth,
Roy
Apr 30 '07 #2
On Apr 30, 8:04 am, geevaa <govivasa...@gm ail.comwrote:
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.....
When I run the code I get the warning. Check that you have
display_errors enabled and error_reporting set appropriately in
php.ini.

Apr 30 '07 #3

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
62
3754
by: ashu | last post by:
hi look at this code include <stdio.h> int main(void) { int i,j=2; i=j++ * ++j * j++; printf("%d %d",i,j); return 0;
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 ''
6
2160
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
3597
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
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
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
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8606
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...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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
4159
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
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.