Re: This, then that.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think I would flush the output at the end before starting the second
script with functions (off my memory) like flush() and ob_flush()

This will ensure that the browser at the other end has received the
whole document and can in fact display it all.

I haven't looked into that myself but, best would be to close the
connection to the client as well, if that's possible, without
terminating the script.  This will prevent that browsers would display
"Loading..." after the page is shown until your second script
terminates.

Simon

On 10/19/07, Nathan Hawks <nhawks@xxxxxxxxx> wrote:
> If by "creates a web page" you just mean it echos output to the browser,
> and you want to do something else after that, then:
>
> After you have sent your </html> and have no more output for the
> browser, just use the include() function to run your extra process.
>
> e.g....
>
> </html>
> <?php include('secondary_script.php'); ?>
>
>
>
> On Thu, 2007-10-18 at 20:19 -0400, TG wrote:
> > Describe the process a little more.
> >
> > PHP script outputs HTML to the browser?
> >
> > PHP script outputs HTML to a file?
> >
> > Is the file created then displayed?
> >
> > Is the PHP script run via command line?  If so, then exec() and some of the
> > other ideas would probably be the way to go.
> >
> > If it creates and displays a page online, you can use a "headler(Location:
> > someurl)" to redirect.  This is subject to user interference of course.
> >
> > Do you need it to spawn the other PHP script and exit or is it ok if it's a
> > child process of the original php script (or whoever that works.. sorry,
> > not 100% familiar with the internal stuff).
> >
> > -TG
> >
> > ----- Original Message -----
> > From: tedd <tedd@xxxxxxxxxxxx>
> > To: <php-general@xxxxxxxxxxxxx>
> > Date: Thu, 18 Oct 2007 15:04:36 -0400
> > Subject:  This, then that.
> >
> > > Hi gang:
> > >
> > > I would like to run a php script that creates a web page and AFTER it
> > > is finished creating the page, then it runs another php script -- how
> > > you do that?
> > >
> > > Cheers,
> > >
> > > tedd
> > >
> > > --
> > > -------
> > > http://sperling.com  http://ancientstones.com  http://earthstones.com
> > >
> > > --
> > > 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
>
>

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux