Parallel script execution + AJAX

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
e11even
Forum Newbie
Posts: 1
Joined: Sat Jul 01, 2006 7:01 pm

Parallel script execution + AJAX

Post by e11even »

Hi all,

I'm trying to develop an application that at some point needs to test a SSH connection to some hosts. I'm using AJAX to perfom the test by making a request to a script < testConnection.php >. Since this can take a while, I wanted to provide the user with some kind of progress indication.

In my approach, as < testConnection.php > runs, I put some status messages in the $_SESSION variable. Meanwhile, in the client side, i make several successive Asynchronous calls to another script < checkStatus.php > that returns the messages stored in $_SESSION.

The problem is that < checkStatus.php > will not run until < testConnection.php > has finished running, and therefore it will display all the messages at once :(

Can someone please help me on getting this to work or suggest another approach in order to achieve this "progress indicator" result?

Thank you in advance,
Post Reply