SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict marylin77's Avatar
    Join Date
    Aug 2003
    Location
    Spain
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a screen to wait while processing

    I`d like to know how to programm a screen which shows "wait...process in progress or similar" while an operation is making (such as , copy of folders or download zip or such as you have in this forum when somebody posts and that screen appears informing you will be forwarded ...you know :])
    The problem is the following:
    I call the function which is in charge of operating something.
    And at the same time i echo or output the message "wait...bla bla".
    If I do
    process() //the function which processes.
    echo "wait..bla bla";
    the message appears AFTER the operation , AND i want it to appear WHILE operation...any idea?
    Regards from Spain and thanks in advance :]

  2. #2
    SitePoint Addict marylin77's Avatar
    Join Date
    Aug 2003
    Location
    Spain
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok...no problem
    I have thought this:
    PHP Code:
    echo "wait...processing";//before calling the function to process
    process();
    echo 
    "FINISHED"

  3. #3
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marylin77
    ok...no problem
    I have thought this:
    PHP Code:
    echo "wait...processing";//before calling the function to process
    process();
    echo 
    "FINISHED"
    Did it actually work? Because it really doesn't matter where you put the echo, php will always run the entire script first and then output the results to an html file.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  4. #4
    SitePoint Addict marylin77's Avatar
    Join Date
    Aug 2003
    Location
    Spain
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and what's your idea?

  5. #5
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did it actually work? Because it really doesn't matter where you put the echo, php will always run the entire script first and then output the results to an html file.
    Actually, that's not true. See this thread for some IMHO pretty cool example on how do achieve a 'loading screen'. Especially my last post.

  6. #6
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gaheris
    Actually, that's not true. See this thread for some IMHO pretty cool example on how do achieve a 'loading screen'. Especially my last post.
    I was wrong I guess, but it comes as no surprise.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  7. #7
    SitePoint Evangelist jplush76's Avatar
    Join Date
    Nov 2003
    Location
    Los Angeles, CA
    Posts
    460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    javascript works well for this
    as Gaheris said.

    just use two div tags, the processing tag invisible and the loading tag visible, then when the function ends, swap visibility and there ya go
    I use that technique with my site and it works great.

  8. #8
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, my solution does not use JS at all. It's pure CSS.

  9. #9
    Non-Member coo_t2's Avatar
    Join Date
    Feb 2003
    Location
    Dog Street
    Posts
    1,819
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    You might wanna check out this Pear package too:

    http://pear.laurent-laville.org/HTML_Progress/

    I've been looking forward to using it, but haven't needed it yet.

    --ed

  10. #10
    SitePoint Member
    Join Date
    Jan 2004
    Location
    Camp Hill, PA USA
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wait while processing

    Try using flush();
    this clears the php buffer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •