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 Aerik on 04/13/07 19:02

> - Have your original PHP store it's "status" information in a Session
> variable says $_SESSION["status_data"] which is updates as it runs
>
> - Have a timer on the Javascript side which creates a 2nd Ajax call
> to a new getstatus.php, which then reads the status from the session and
> sends back to the browser in this 2nd Ajax call.
>
> Not done much Ajax, I am assuming you can make another ajax call whilst
> one is currently running??


Wow, that's really clever actually. The only think I'm not sure about
is when first script actually saves the session data - I don't know if
it gets saved as it's set, or if it saves it when the script
completes. Yes, you can definitely send multiple ajax requests. I
think what will happen if the script runs really long is that the
first one might time out - I'm really not sure. But you should
definitely be able to get the process going with one ajax call, then
poll the second script for the status. Yeah, I'd love to hear how
this works out as well...

Aerik

 

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

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