Jump to content

Recommended Posts

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,
Link to comment
https://forums.phpfreaks.com/topic/13421-parallel-script-execution-ajax/
Share on other sites

Hi,

Thanks for the tip, I tried it but it didn't work cause the cookie is set only after < testConnection.php > starts outputting some contents and that's in the end of the script. I'm I missing something or theres anyway to force the update of the cookie before the script ends? Some way of "flushing" the headders?

Thanks once again,
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.