PHP and run 2 scripts

I would like to have a background script running that will run continuously but am having problems in trying to get it working, if it is possible.  Basically a user submits a form and it'll load two scripts, one background script and one foreground script.  I tried using frames to do it, with the background script in one frame and a foreground script in another frame.  But if the background script runs continuously in the first frame the second frame which contains the foreground script can never get processed.  Also the foreground script will refresh probably about every 30s or so and I am using meta tags to do it.  So how can I have a background script continuously running and also have the foreground script be processed as well?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi kdavidm,

Not entirely sure what it is that you are trying to do.   What are these scripts actually going to be doing?  Particularly, what is the script that you want to be running continuously?  Since PHP is server side.. I'm not sure what the background script could actually be doing that would require it to be running indenfinitely.
kdavidmAuthor Commented:
The background script just gets updates from user interaction and communication then stores the data in a database, the foreground script reads in these updates from the database and outputs them every 30s for example.  Yes I know it isin't very efficient and yes there are better and more simpler ways to do it without using PHP, but I want to use PHP to do it.  So I would like to know if it's possible to have two scripts running, one background continuously and one foreground.
I don't think you can really accomplish this with just PHP.  If you're wanting to retrieve client-side information continuously without the user actuall submitting something, I think you would need to use some type of Javascript (possibly an AJAX script), or even ActiveX.  Regardless of how you do it.. you can't just have a stand-alone PHP script that actually RUNS continuously and keeps retrieving client-side data.  PHP doesn't work the same way a Windows executable or service would work, for example.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

PHP script ends the moment it is relivered to the client and no way to leave it running. Maybe you can use php-java integration, haven't tried it my self, but have a look at that link
Try to take a look PHP command line
PHP-CLI (Command Line Interface), may it can work for your case.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.