Re: header() ???
| From: | David Robley | Date: | Thu, 14 Sep 2000 02:25:54 +0000 |
| Subject: | Re: header() ??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16670@lists.php.net to get a copy of this message | ||
On Thu, 14 Sep 2000, Sonia Tsui wrote:
> When does header() need to be called?
>
> let's say:
>
> =========
> index.php
> =========
> <a href="<?php echo("myscript.php"); ?>...... </a>
>
>
> ==========
> myscript.php
> ==========
>
> <?php
> $cmd = "something";
> exec("$cmd");
> <--------- header() ????
> include "index.php";
> ?>
> -------------------------------------
> I asked since for Perl CGI, this is needed:
>
> print header;
> if (open(fp,"<index.php")) {
> while (<fp>) {
> print;
> }
> }
>
>
> ---Sonia
In a nutshell, it needs to be called before you send ANY output; even
spaces or empty lines before it will cause errors.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA