Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Loading bar

  • 11-07-2006 4:46pm
    #1
    Registered Users, Registered Users 2 Posts: 1,086 ✭✭✭


    I am designing a website using php / html / javascript.

    I have some jobs which take a few seconds to do depending on how much information is being processed.

    I want to insert a loading bar which shows percentage completed or something similar.

    I have no flash on my site so would like to avoid that if possible.

    Any solutions?


Comments

  • Registered Users, Registered Users 2 Posts: 4,100 ✭✭✭muckwarrior


    AJAX. Haven't a clue about using it with PHP though.


  • Closed Accounts Posts: 22,479 ✭✭✭✭philologos


    GD Library is good for charts. I havent used it for that purpose yet however


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    Ajax is your man. I can even supply some javascript to show ya how it works, if ya really need it. But you'd probably be best grabbing a tutorial off somewhere. You can only do what you're thinking of if you do it asynchronously, which is why you need ajax.


  • Closed Accounts Posts: 25 withneill


    I think you would be quicker using a flash preloader bar. PHP is great but i would think the scripting would be messy. If your really stuck let me know, I did one a while back -it took a while- and I could dig out the script-but only if your really head scratched


  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew




  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,086 ✭✭✭Peter B


    Thank you so much for the replies.

    I think the problem with php is is sends the information from the server all in one go.

    I have also noticed a difference in my browser and how it deals php generated files compared to my browser at work.

    I use Firefox both at home and at work but at home it will not display a page / image until it has loaded fully, which is annoying on a slow internet connection like I have.

    If I am running a php page which does multiple tasks it will only display the output from the tasks when the page is finished, however at work my browser displays the php's output immediately as it happens so my output page gradually displays live as the commands are done.

    So this brings me to my choices, if I were to consider all users would have a browser which allow the webpage to be appended as each different process is completed I could list the information down as it gets done.

    Otherwise if I could somehow, make it possible to change the text in a certain area on the page (asynchronously I think) as each job is completed, I could make a sort of status bar showing progress with jobs completed, approx % etc.

    The last option would be to make a users input trigger a page which would run on the server but the user would not need to wait for its completion. The user would be sent to a page which would explain to them that their information is being processed. I don't know if it possible that way to make 2 pages run simultaniously from a single browser.

    Anyway I hope I am making some sense. My program accepts input in from the user. If that input is not already contained in the database it will have to be returned from other sites, like how a price comparison site works. However the delay on getting information can sometimes take a lot of time - from 0.5 - 30 seconds, and if there is 25 processes being completed, I would like people to see how the process are going and how far they are through them. Otherwise like I said before, if I can somehow create a trigger page which will be initated by the user, but not require the user to wait for completion.


  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    Peter B wrote:
    The last option would be to make a users input trigger a page which would run on the server but the user would not need to wait for its completion. The user would be sent to a page which would explain to them that their information is being processed. I don't know if it possible that way to make 2 pages run simultaniously from a single browser.
    Look into non-parsed headers. IIRC these allow you to slowly send data to the client with a unique marker indicating a new page.
    Look into how EBookers do it. When you search for flights a 'Please wait' page comes up while it is searching. Then you get sent to the results page.


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    Peter B wrote:
    Otherwise if I could somehow, make it possible to change the text in a certain area on the page (asynchronously I think) as each job is completed, I could make a sort of status bar showing progress with jobs completed, approx % etc.
    I wonder what the A in AJAX stands for?


Advertisement