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

    Join Date
    Jul 2000
    Posts
    1
    Rep Power
    0
    I'm doing a lengthy process in PHP but I want to keep some updates (eg percent complete) on a HTML document that the user is viewing. Is there anyway to force a page to refresh itself from php? Another way that I thought could be done, was to have the HTML page, made by php, refreshing automatically, and then another script which is doing the long process, passing new variables as to what percentage is complete, but I have no idea as to the passing.
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    Is there anyway to force a page to refresh itself from php?
    >>

    No,You should do refresh from client side...

    what i would suggest is that just include refresh meta tag in your html result page.
    it will refresh the php page frequently.
    so your latest updates will be available in that new resultpage(i mean yourphp page).

    eg:

    yourpage.php3
    ---
    echo "<html>n";
    echo "<head>n";
    echo "<meta http-equiv="refresh" content="10; url=yourpage.php3">n";
    echo "</head>n";

    ---- ---
    ---

    ---


    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited July 07, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    22
    Rep Power
    0
    that's what i've been working on since i posted the message. my only problem is, is that how do i pass the new %age to the refreshing page. I've tried using the code actually downloaded free from the Ultimate Bulletin Board, but that's in cgi and seems complicated so i'm having trouble.
  6. #4
  7. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    1. what ubb code might that be?

    2. post it here and we'll try and translate it for you .

    3. how lengthy is the process??!? PHP is VERY fast at doing it's job. You'd have to be rebuilding databases or html pages or something for it to take any time at all.
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    What is the other process? - you could in theory get the other process to update a database field at regular intervals and then run a query from the refreshing page at set intervals using Shiju Rajan's example, but this will no doubt slow the other process down as well.

    And this is assuming that the other process is capable of writing to a db or flatfile - I too am intrigued about the time factor on the other process!

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  10. #6
  11. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    is that how do i pass the new %age to the refreshing page.
    >>


    since you are refreshing the .php page ,i don't think it would be a difficult problem.

    just write a function for latest %age updation. and print it in the html..

    <?
    echo "<html>n";
    echo "<head>n";
    echo "<meta http-equiv="refresh" content="10; url=yourpage.php3">n";
    echo "</head>n";

    new_percentage();

    function new_percenatge(){
    ----- --- ---
    ----- --- ---
    }

    ?>

    or you can use the %age as an include file...

    <?
    include("percentage.php3");
    ?>

    Good Luck!!


    ---- ---
    ---

    ---



    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    22
    Rep Power
    0
    i got the code from the ultimate bulletin board website where youit downloads the code when you download the site www.ultimatebb.com i believe

    my problem with refresh is that if I keep refreshing the php file, it'll keep starting the main process again which means it'll never finish.

    the process that i'm doing is rather large and works with mysql.

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  2. How to see the Memory used by a PHP script?
    By Pardall in forum PHP Development
    Replies: 4
    Last Post: February 13th, 2004, 04:54 PM
  3. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 02:14 PM
  4. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 04:12 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 02:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo