How to display web page continuosly?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • veg_all@yahoo.com

    How to display web page continuosly?

    I have a script that takes collects info from various websites to
    compile a report. However whenever I run it, my web browser waits for
    the script to finish ( 1 minute ) before displaying the report. But my
    script is outputting data every few seconds . So is there a way to
    make my browser display the web page every few seconds and update
    automatically as more data comes?

  • OmegaJunior

    #2
    Re: How to display web page continuosly?

    On Fri, 02 Mar 2007 06:59:43 +0100, <veg_all@yahoo. comwrote:
    I have a script that takes collects info from various websites to
    compile a report. However whenever I run it, my web browser waits for
    the script to finish ( 1 minute ) before displaying the report. But my
    script is outputting data every few seconds . So is there a way to
    make my browser display the web page every few seconds and update
    automatically as more data comes?
    >
    Yup, there is. It's called AJAX, and it's javascript method. You can use
    it to have a web page waiting for input from another script (in your case
    the php script).


    --
    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

    Comment

    • Michael Fesser

      #3
      Re: How to display web page continuosly?

      ..oO(OmegaJunio r)
      >On Fri, 02 Mar 2007 06:59:43 +0100, <veg_all@yahoo. comwrote:
      >
      >I have a script that takes collects info from various websites to
      >compile a report. However whenever I run it, my web browser waits for
      >the script to finish ( 1 minute ) before displaying the report. But my
      >script is outputting data every few seconds . So is there a way to
      >make my browser display the web page every few seconds and update
      >automaticall y as more data comes?
      >
      >Yup, there is. It's called AJAX, and it's javascript method. You can use
      >it to have a web page waiting for input from another script (in your case
      >the php script).
      Two years ago the answer probably would have been as simple as

      | Try flush() to force the script output being sent and don't put the
      | entire page into a big table, as some browsers are not able to render
      | it incrementally.

      Today all folks cry for AJAX immediately, even for something as simple
      as a status report ...

      Micha

      Comment

      • met00

        #4
        Re: How to display web page continuosly?

        Michael Fesser wrote:
        Today all folks cry for AJAX immediately, even for something as simple
        as a status report ...
        AJAX will solve all problems. If it fails to, try Mr. Clean. Yeah he's
        got an earing, but man is he tough on dirt and grime.

        Comment

        • Jerry Stuckle

          #5
          Re: How to display web page continuosly?

          veg_all@yahoo.c om wrote:
          I have a script that takes collects info from various websites to
          compile a report. However whenever I run it, my web browser waits for
          the script to finish ( 1 minute ) before displaying the report. But my
          script is outputting data every few seconds . So is there a way to
          make my browser display the web page every few seconds and update
          automatically as more data comes?
          >
          Two things can be happening here:

          1. PHP and Apache are caching the data. Calling flush() should send it
          to the browser

          2. The browser itself is caching before displaying. Some browsers will
          do this if they can't display things right away (i.e. a table without
          columns and widths defined). Simplifying your HTML could help here.

          I'd use AJAX as a last resort. It's way overkill for something like this.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          • Gootes

            #6
            Re: How to display web page continuosly?

            flush() is good, but AJAX is modern and cool and everybody wants modern and
            cool webs :)

            Michael Fesser wrote:
            .oO(OmegaJunior )
            >
            >>On Fri, 02 Mar 2007 06:59:43 +0100, <veg_all@yahoo. comwrote:
            >>
            >>I have a script that takes collects info from various websites to
            >>compile a report. However whenever I run it, my web browser waits for
            >>the script to finish ( 1 minute ) before displaying the report. But my
            >>script is outputting data every few seconds . So is there a way to
            >>make my browser display the web page every few seconds and update
            >>automatical ly as more data comes?
            >>
            >>Yup, there is. It's called AJAX, and it's javascript method. You can use
            >>it to have a web page waiting for input from another script (in your case
            >>the php script).
            >
            Two years ago the answer probably would have been as simple as
            >
            | Try flush() to force the script output being sent and don't put the
            | entire page into a big table, as some browsers are not able to render
            | it incrementally.
            >
            Today all folks cry for AJAX immediately, even for something as simple
            as a status report ...
            >
            Micha

            Comment

            • Michael Fesser

              #7
              Re: How to display web page continuosly?

              ..oO(Gootes)
              >flush() is good, but AJAX is modern and cool and everybody wants modern and
              >cool webs :)
              modern + cool = unreliable ;)

              AJAX is optional, server-side stuff works always.

              Micha

              Comment

              • Petr Vileta

                #8
                Re: How to display web page continuosly?

                <veg_all@yahoo. compíse v diskusním príspevku
                news:1172815183 .200690.261000@ s48g2000cws.goo glegroups.com.. .
                >I have a script that takes collects info from various websites to
                compile a report. However whenever I run it, my web browser waits for
                the script to finish ( 1 minute ) before displaying the report. But my
                script is outputting data every few seconds . So is there a way to
                make my browser display the web page every few seconds and update
                automatically as more data comes?
                >
                Use flush() and some other tricks.
                1) do not use <tabledesign or if you must, use a short tables. Many
                browsers do not dispaly anything until get the </tabletag.
                2) Many browsers wait for unspecified number of bytes before dispaly part of
                page content. To avoid this you can send say 1024 spaces - char(32) - after
                each data you need to display immediately. Browser reduce these 1024 spaces
                to 1 only but must show content.
                --

                Petr Vileta, Czech republic
                (My server rejects all messages from Yahoo and Hotmail. Send me your mail
                from another non-spammer site please.)


                Comment

                • veg_all@yahoo.com

                  #9
                  Re: How to display web page continuosly?

                  thanks for the replies, flush worked perfectly, wish I had known about
                  that before as AJAX is too complicated for something so simple.

                  Comment

                  • OmegaJunior

                    #10
                    Re: How to display web page continuosly?

                    On Fri, 02 Mar 2007 10:06:08 +0100, Michael Fesser <netizen@gmx.de wrote:
                    .oO(OmegaJunior )
                    >
                    >On Fri, 02 Mar 2007 06:59:43 +0100, <veg_all@yahoo. comwrote:
                    >>
                    >>I have a script that takes collects info from various websites to
                    >>compile a report. However whenever I run it, my web browser waits for
                    >>the script to finish ( 1 minute ) before displaying the report. But my
                    >>script is outputting data every few seconds . So is there a way to
                    >>make my browser display the web page every few seconds and update
                    >>automatical ly as more data comes?
                    >>
                    >Yup, there is. It's called AJAX, and it's javascript method. You can use
                    >it to have a web page waiting for input from another script (in your
                    >case
                    >the php script).
                    >
                    Two years ago the answer probably would have been as simple as
                    >
                    | Try flush() to force the script output being sent and don't put the
                    | entire page into a big table, as some browsers are not able to render
                    | it incrementally.
                    >
                    Today all folks cry for AJAX immediately, even for something as simple
                    as a status report ...
                    >
                    Micha
                    Hey, veg_all asked for any solution, not the easiest one. Had I known
                    about flush() I probably would've opted that too.

                    Thank you for sharing!

                    --
                    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

                    Comment

                    Working...