Jump to content

PHP waiting page


raman

Recommended Posts

I want that my PHP script should display a wait message "Please wait, you job is under processing" while the script is not done.

 

For this I am trying to use file_exists function to check whether the output file exists or not,



while(!file_exists($result)){
  # some code for which I need help  echo "<META HTTP-EQUIV=\"refresh\"  content=\"10;URL=selfscript.php"
}

 

 

I want that in the portion where I have put # some code for which I need help, there should be some code, something like meta tags that will keep refreshing the page every 10 seconds till the job is done and display the output when $result is available.

 

Can someone help me with the exact code.

Link to comment
https://forums.phpfreaks.com/topic/159683-php-waiting-page/
Share on other sites

What you're trying to do wont work with only php. php is server side and will only pass data to the browser for parsing.

 

You may want to consider using ajax. You can display a message on the client side while an ajax request is sent executing another php script to somplete a task. On it's completion you use javascript to update the page content appropriately.

Link to comment
https://forums.phpfreaks.com/topic/159683-php-waiting-page/#findComment-842192
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.