-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|553|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Website Development


 
JL235
Created : 30 July 2010
Edited : 30 July 2010
System : PSP Vita
Language : Flash

Post PHP server-side execution

Continue executing a PHP script after page has been sent

Imagine this scenario. You have a webpage that a user accesses, it's sent across, and then after the page has been sent you want to execute some expensive PHP code.

The issue is that the users browser will continue to say the page is loading because the connection remains open. This code solves this issue. It works by ending the previous HTTP content being sent at the start of your PHP script and then sends a new header which it ends itself later.

Library



Example Usage

Import it, call startHTTPConnection() at the start of your PHP script and endHTTPConnection() at the end of sending your HTML (before your post-script processing).

 

Comments


Sunday, 01 August 2010, 10:18
HoboBen
Thanks!