RE: [PHP-DB] headers

From: Date: Sat, 07 Apr 2001 17:16:49 +0000
Subject: RE: [PHP-DB] headers
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-8337@lists.php.net to get a copy of this message
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 Webmaster@corin.org.uk P.S. If you use the script you need the GD Image librays installed and enabled. -----Original Message----- From: Sharmad Naik [mailto:sharmad@goatelecom.com] Sent: 07 April 2001 08:16 To: php-db@lists.php.net 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: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#8337) next »