Advertisement
Guest User

Untitled

a guest
Jan 28th, 2014
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. ignore_user_abort(true); // Ignore user abort
  4. set_time_limit(0); // Allow script to run forever
  5.  
  6. while(1)
  7. {
  8.     echo chr(0);
  9.     ob_flush();
  10.     flush();
  11.    
  12.     /* connection_status would always return 0 without the 3 instructions above */
  13.     if ( connection_status() != CONNECTION_NORMAL )
  14.     {
  15.         // Create this file when the connection's aborted
  16.         file_put_contents('connection_aborted', '');
  17.         break;
  18.     }
  19.    
  20.     sleep(1);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement