troubleshooting Question

Update page using Ajax while PHP script is running

Avatar of darklandsinc
darklandsinc asked on
JavaScriptPHP
1 Comment1 Solution822 ViewsLast Modified:
I am using PHP to parse XML data, which ultimately gets stored into a database. However, while I am downloading and parsing the XML (which takes about 30 seconds), I would like to give the user status reports.

Since I am on Apache 1.0.33, I cannot do any type of page flushing to force output to the browser.

What I would like is to use Ajax to update the status div element while my script is running.

The only solution I have in mind is to use 2 hidden iframes. 1 frame holds the actual script that parses data, and stores messages in a $_SESSION and a second script that reloads (using javascript) every second or so, reads the contents of the $_SESSION message and updates the form.

However, this does not seem to be a very elegant solution. I guess I want more of a event-driven solution.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros