Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


when you will get the message/error "headers already sent"?

Answers were Sorted based on User's Feedback



when you will get the message/error "headers already sent"?..

Answer / luan nguyen

you get header already sent when you call header() after you
have posted other data to the browsers.
Example:

<?php

echo "Hello World";
header("Location: http://new.url.com");

?>

Is This Answer Correct ?    5 Yes 0 No

when you will get the message/error "headers already sent"?..

Answer / suren

if u print any message on the browser using echo statement
or any html tags before using the "session_start()" like
statements in the scripts.
if u want to overcome that problem
simply write "ob_start();" at the very starting of script
and "ob_end_flush();" at the end.

Is This Answer Correct ?    3 Yes 0 No

when you will get the message/error "headers already sent"?..

Answer / vishwanath

php have header_sent() function to check the headers are
sent or not

Is This Answer Correct ?    2 Yes 1 No

when you will get the message/error "headers already sent"?..

Answer / shiva

This is due to whitespaces before php tags you are leaving
at the starting of the line.

Is This Answer Correct ?    2 Yes 1 No

when you will get the message/error "headers already sent"?..

Answer / dhiraj

when we are using the session variable..and want to start
our session.. we use session_start(); in the very first
line.
anything occur before this line, even a single space we get
the headers already sent error.
To overcome this problem, we can use ob_start(); at the
very first line and ob_end_flush(); at the end of the
script..

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More PHP Interview Questions

Why do we use htaccess and where?

0 Answers  


What is $_ request in php?

0 Answers  


Define urlencode() and urldecode() used in php?

0 Answers  


What is the importance of "method" attribute in a html form?

0 Answers  


Write a php function to convert all null values to blank?

0 Answers  


what is the dirrence in PHP4 & PHP5 . ?

8 Answers  


how to upload more than 50 mb? i tried but session was expired....certain time .....i was set session duration three days .... how to rectified? if any one know that post ur answer as soon as possible?already i was increase php.ini and set Also increase Memory_limit Post_max_size upload_max_filesize..........but not working......

0 Answers  


how to use http headers inside php? Write the statement through which it can be added?

0 Answers  


What are the final class and final method?

0 Answers  


Hi all, I have a problem in Apache on windows xp.I tried to unistall apache and install it again. But when in did the installation again, and tried to run apache, i get the following error message, Socketaddresse can just be used once. Make_sock: could not build to address 0.0.0.0.80 No listening sockets available.Shutting down Unable to open logs. and i also get (error) OS2. The system cannot fine the installed service named "Apache2". Please i need some one to help me out with this.I'm really fustrated cuz i need this stuff working as fast as possible. PLEASE HELP ME

2 Answers  


How we get browser details of clients machine?

0 Answers  


How to open a file for reading?

0 Answers  


Categories