|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Does any know how to show the status os a PHP script while the script is still running.
I only need to make this work using FF. It is a backend script. The script can take several minutes to parse. It is essentially a bot parsing large amount of text and adding results into a database. Something like this: Extraction Started..... then Looking for matches..... then Creating Array..... then etc..... I have played with flush() and ob_flush(). They only show the results after the script is fully completed. I would like the results not necessarily line by line but module by module. Any Ideas? |
|
|||
|
I don't think that will work!!
|
|
||||
|
I have a PHP script that has to cycle through XML feeds containing hundreds of thousands of elements once a month. I use the same basic methodology you are looking for where it outputs a '.' each time it processes an XML element so I know the script hasn't died. The basic code is the following:
echo '. '; if ($a % 10 == 0) { ob_flush(); flush(); } You can remove the if and closing brace lines so it will force output to the browser after each individual '.'. In my case, outputing the dots in groups of ten is sufficient. In my case, AJAX calls wouldn't work because the script needs to also be executed by the operating system and by wget and cron.
__________________
The best way to learn anything, is to question everything. |
|
|||
|
wige
You nailed it. Got it figured out about an hour after making the post. I thought AJAX at first. The problem with AJAX is you would have to open a HTTP stream for this to work. This would cause for resource issues during heavy traffic. The script will be used for on the backend of the site. It could still impact the frontend resources. I did find that I had to make modifications which are covered under flush() @ php.net. Mods included things like verify INI file, virus software, etc... Anything that could potentially buffer content. Anyways thanks for the help! |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PR Update is running | govindseo | Google Discussion Forum | 10 | 09-30-2008 11:44 PM |
| Getting out of the rat race and running it alone... | Graf1771 | Marketing Strategies Discussion Forum | 35 | 04-29-2007 05:14 PM |
| Persistent Data: File Input and Output | WPW_Feedbot | Graphics & Design Discussion Forum | 0 | 08-25-2005 11:04 AM |
| XML Output | MidNite | Flash Discussion Forum | 1 | 12-12-2004 02:06 PM |
| PHP field - output a URL from Admin area? | cyberious | Web Programming Discussion Forum | 1 | 01-09-2004 03:18 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |