You need to put the headers before any output has been sent to the user, not
line on line 6, line 2 if possible. This includes spaces or blank lines
before the start of your php.
e.g. Here is script that creates a simple image:
<?php
header ("Content-type: image/png");
$im = @ImageCreate (200, 200) or die ("Cannot Initialize new GD image
stream");
$background_color = ImageColorAllocate ($im, 00, 00, 00);
$text_color = ImageColorAllocate ($im, 233, 14, 91);
ImageString ($im, 90, 20, 20, "Hello", $text_color);
ImagePng ($im);
?>

Regards,
Corin Rathbone
[EMAIL PROTECTED]

P.S. If you use the script you need the GD Image librays installed and
enabled.


-----Original Message-----
From: Sharmad Naik [mailto:[EMAIL PROTECTED]]
Sent: 07 April 2001 08:16
To: [EMAIL PROTECTED]
Subject: [PHP-DB] headers


When ever i add headers in my pages i get the following errors
Can anybody tell me what's wrong?

Warning: Cannot add header information - headers already sent by (output
started
 at /usr/src/apache_1.3.14/web/server/apache/htdocs/searchdisplay.php:4) in
/usr
/src/apache_1.3.14/web/server/apache/htdocs/searchdisplay.php on line 6

-Sharmad
--
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
__    _  _      _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to