You are here: Re: Using AJAX, how can the page get state infomation from backgroud PHP script? « PHP Programming Language « IT news, forums, messages
Re: Using AJAX, how can the page get state infomation from backgroud PHP script?

Posted by Schraalhans Keukenmeester on 04/13/07 19:58

Marvin Zhang wrote:
> Hi,
>
> I'm not familiar with web programming, but I have a problem here.
>
> I have a page. When a user click one button on it, I will use AJAX to
> request a PHP script which will do a bunch of tasks, asynchronously.
> These tasks might take long time so I want to keep the user informed
> of the progress. The problem is that only the PHP script knows the
> progress, how can the web page gets these information from PHP script?
>
> I'd really appreciated if someone could help me solve this problem.
>
The suggested 2nd AJAX call is by far the most elegant solution I'd say.
From when I never even heard of AJAX I found a 'faked' workaround for
user feedback during a long wait:

I found a script to make animated gifs on the fly, drew a progress bar
with several separately saved frames, and used that to set the frame
delay to a custom value based on a rough guesstimate on the server of
the total execution time of the loop or whatever caused a long delay for
the user.

Of course with JavaScript this could be handled much more gracefully.

Sh.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация