Re: Warning with Header("Location: test.php")

From: Date: Tue, 26 Nov 2002 06:56:42 +0000
Subject: Re: Warning with Header("Location: test.php")
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126052@lists.php.net to get a copy of this message
Hi, * Padmini.Dey@desconsoft.com wrote: > Warning: Cannot add header information - headers already sent by (output > started at /var/www/html/test.php:5) in /var/www/html/test.php on line 15 You see that the output began on /var/www/html/test.php on line 5. It may be a char or even a whitespace. Normally you shouldn't have any output before the Header() call. But you could also use output buffering to have output even before the header calls (PHP will sort the output stacks and send the header stack first), i.e. <?php ob_start(); print "Hello"; Header("Location: http://www.php.net/"); ?> -- PHP Magazines for Professionals PHP Magazin * PHP Magazine http://www.phpmag.de/ * http://www.php-mag.net/ German Edition * International Edition with own topics

« previous php.general (#126052) next »