Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    using a "loading" icon with PHP on a form submit

    I have a form submit which does a bit of work check if URLs are good URLs or not.. sometimes the form submission takes a few seconds before an output is resulted.

    I know in AJAX you can use a "loading" icon while the XHR occurs.

    for a PHP form submission:

    Code:
    if(isset($_POST['submit'])){
    
    ... proces URL here
    
    }
    are there any tricks in PHP where a 'loading' icon can be used and once the output is resulted the loading icon is replaced by the result output?

    I assume this can only be done client side (javascript).. just wondering if anyone happens to know something I new that I don't. (I am using PHP v5.xx)

  • #2
    New Coder
    Join Date
    Oct 2007
    Location
    Irwin, PA
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts
    From what I know, there is no possible way to manipulate how fast PHP loads in the script that is executing to make a loading screen. It would have to be done, like you said, in something like Javascript. Maybe some type of function that, as the page loads, create a timer and while that timer clicks, show the load icon.

    Personally, I think it's dumb to make a loading icon. People want to navigate as quick as possible, they don't need to be delayed by a screen that is purposely loading slow.


  •  

    Posting Permissions

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