?
Solved

Displaying data as it is produced rather than at completion

Posted on 2006-04-03
4
Medium Priority
?
219 Views
Last Modified: 2008-03-17
I have an ASP script that sends out emails from a database.  It loops through the db and sends a single email to each person in the list.  When the user runs this script, it slowly pops up a confirmation message as each email is sent (maybe a couple a second or so).  So after all is said and done you have a web page with a big list of emails that were sent.

I am now creating a similar script using PHP.  It is working fine, except the messages do not show up until the entire list has been sent.

Is this an ASP/PHP feature, a server setting, or is there some way to craft a header or something so you will get output before the page has been entirely created.

Thanks.
0
Comment
Question by:CIC Admin
2 Comments
 
LVL 27

Accepted Solution

by:
Nopius earned 2000 total points
ID: 16367658
Page buffering is done by WEB server.
You may insert flush() call to your PHP script when you want the generated output to be sent to browser, read http://php.rinet.ru/manual/ru/function.flush.php



Also here are useful links of buffering control: http://www.devshed.com/c/a/PHP/Output-Caching-with-PHP/
And about HTML Server side PUSH technology: http://wp.netscape.com/assist/net_sites/pushpull.html

0
 
LVL 9

Expert Comment

by:blue_hunter
ID: 16377973
check out which accelator ur web server is currently using.
Some configuration is needed for your request
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question