Thread: Updating Page

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    22
    Rep Power
    0
    I've done a large PHP script which can take a long time to run. This script has to have an echo every so often so that it doesn't time out. I've been looking for quite a while for a way of updating a PHP page so that the text will actually be shown on the screen as it outputs rather than when all the script has finished.
    Working on another project using ASP (JavaScript) I found the following out:

    <% Response.Buffer=True %>
    <% Response.Flush %>

    which actually updates the page. Is there anyway of implementing this in PHP or something like it.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Melbourne, Victoria, Australia
    Posts
    104
    Rep Power
    14
    For individual (what you call "updates") you can use flush().

    There is a directive that you can use in php.ini that has the effect of flush()ing the output after every output command (eg print(), echo(), printf() etc) although it will slow down your script dramatically and increase server load. It's in the standard dist of php.ini.

    Hope that helps,

    Josh

Similar Threads

  1. Replies: 11
    Last Post: February 21st, 2004, 06:48 AM
  2. Replies: 2
    Last Post: February 11th, 2004, 03:15 PM
  3. Replies: 0
    Last Post: February 8th, 2004, 10:11 PM
  4. passing the url from HTML page to a php
    By lordorkus in forum PHP Development
    Replies: 10
    Last Post: January 20th, 2004, 05:36 PM
  5. Replies: 4
    Last Post: January 6th, 2004, 03:56 PM

IMN logo majestic logo threadwatch logo seochat tools logo