Forum Moderators: coopster

Message Too Old, No Replies

Cut of connection though continue processing?

         

JAB Creations

11:47 am on Nov 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm curious if there is a command in PHP that tells the server to finish sending the requested file (let's say after sending </html>) though to continue processing PHP?

For clarification let's say you wanted to execute code that would add several seconds of waiting before the page would finish loading even if all the code was received.

- John

Readie

1:59 pm on Nov 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<?php

echo 'This text appears before some heavy processing';
ob_flush();

require_once 'some_really_cpu_intensive_file.php';

?>


Is that what you're after?

JAB Creations

2:47 pm on Dec 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Awesome thanks! I tested that out with an echo and confirmed it.

- John