/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] showProgressMessage functionality

I have a function called showProgressMessage, looks like this:

[code]
function showProgressMsg($msg)
{
echo $msg.”<br>”;
ob_flush();
flush();
usleep(25000);
}
[/code]

Now, I initialize my scripts like this:

[code]
ini_set(‘output_buffering’, ‘Off’);// delete the 4096k value
ob_start ();
[/code]

Now, when I call showProgressMessage, i.e.

[code]showProgressMsg(“Getting dgdPart.”);[/code]

it is supposed to immediately be shown in the browser window.

But it is not. It waits until the script is finished before showing
anything on the screen.

I have more than one script using this and one of them works but
the others don’t. I have done exactly the same thing in all the
scripts. What could be the cause of the problem?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 01.2010 — I don't know why one would work and the others don't, other than that the web server itself may be configured for some sort of buffering, and it may be that the one that "works" just happens to fill the web server's buffer when you do your flush()?
Copy linkTweet thisAlerts:
@MrBaseball34authorJul 01.2010 — I am using only one server as well as WAMP development environment both configured the same.

one script works on both my web server and localhost whereas the others don't work on either.
Copy linkTweet thisAlerts:
@criterion9Jul 01.2010 — 
one of them works but

the others don't. I have done exactly the same thing in all the

scripts.
[/quote]

There must be something missing. Do you have .htaccess files that might be changing configurations perhaps? Do you get any errors/notices/etc? Maybe something is being output into a log file (in the case you have error reporting suppressed)?
Copy linkTweet thisAlerts:
@MrBaseball34authorJul 01.2010 — I have it working now with ob_implicit_flush
×

Success!

Help @MrBaseball34 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...