0

Does php have the ability to do this:

Let's say you have an observatory. To start a photographing run, you would load the page and click a button. This would make the server start another script, which would run in the background. The page would then update every second (or whatever) with the current information about the observatory.

What I am wondering is if PHP can run in the background like that, and still provide updated status information on page refresh.

2 Answers 2

2

What you need is 'AJAX' (Asynchronous Javascript and XML) .. And this is not PHP's ability. The client side script will send asynchronous requests to the server side script, after the page is loaded. It (client side script) will receive responses, and update the page accordingly.

Have a look at these:

Also have a look at this:

Sign up to request clarification or add additional context in comments.

2 Comments

But can I have a script that stays running regardless of whether the page is loading?
I guess you are looking for a daemon written in PHP. There's lot info on the net under that term, e.g. re-cycledair.com/php-dark-arts-daemonizing-a-process
1

I guess you are looking for a daemon written in PHP. There's lot info on the net under that term, e.g. re-cycledair.com/php-dark-arts-daemonizing-a-process

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.