I have a website that uses the eBay API to load everything into eBay and everything else.
The main files are PHP that are just included into one file that calls the scripts when needed.
But what I am after now is creating a simple website that will be split down the middle one half contains the links to the scripts and the other a plain empty div that loads the contents from the PHP files and displays this in the empty div.
As the php files are mostly run on loops and can run for as long as 5 minutes I would like the script to echo out what it has done in the empty div.
At the minute I am using
while (@ob_end_flush());
ob_implicit_flush(true);
so the PHP scripts output the echo’s before the end of the file, but when using:
function loadScript() {
$(".loading").load("load.php");
Loaddelay = setTimeout('loadScript()',1000);
}
loadScript();
In the main index file that re-loads the file every 1 seconds and shows nothing. as the script cannot actually run.
What other options do i have of dynamically changing the div container so it contains the running PHP script?
2
Answers
in the end I realised that I actually didn't need to use jQuery to load the page like I was doing.
I just ended up using an iframe that was placed within the div.
it works fine, and better then expected. cannot believe I overlooked using an iframe.
If the information is not confidential or sensitive, one thing you could do is pipe the output of the script that takes time to execute to a file and read that file from your page using jQuery.load().
So you would :
Note that you would need to refine the way you define the session variables if the user was to execute multiple pages at the same time