Hi Graham,

This works fine! Without the ob_start and ob_flush commands, all the
header() commands have to be put before the HTML <html> tag, otherwise an
error is displayed about header information that was already sent. Now i put
ob_start() on the first line before <html> and i can put the header()
command everywhere before ob_flush()! Suggestions from others about using
the "include" command doesnt work fine because the php name in the browser
isnt changed to the new php file and that results in some variables like
$_SERVER['PHP_SELF'] keeps pointing to the old php script.
This works fine, but i'm surprised that this was such a difficult question
(i'm not very experienced in PHP). I expected that there would be some kind
of command like "load script.php" to call a new script. Without your
solution you have to let some user constantly push a link or button and
define a new php script to that action.
Thanks for your help!

Regards, Arnold

"Graham Cossey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> For my own clarification, would it not be possible to use output buffering
> and then either redirect to another script using header() or output the
> buffer contents?
>
> <?php
>   ob_start();
>
>   [php code]
>
>   if ($variable = 1)
>     header("Location: script1.php");
>
>   if ($variable = 2)
>     header("Location: script2.php");
>
>   ob_flush();
> ?>
>
> thanks
>
> Graham
>
> -----Original Message-----
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> Sent: 02 October 2004 21:07
> To: Arnold
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] How to load another php page?
>
>
> Arnold wrote:
> > Ok, i can live with it, include works but this doesnt replace the whole
> > running script, only the rest of the script (what is still coming), so
if
> a
> > few things have been written in "a.php", when "include('b.php') is
> executed,
> > this "b.php" does not replace all the (allready written) output of
> "a.php".
>
> That's how the life goes. Once you say something, you can't take it
> back. So think first, then open your mouth :) (put your logic before the
> output).
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to