note 54713 added to function.flush

From: Date: Wed, 13 Jul 2005 13:54:20 +0000
Subject: note 54713 added to function.flush
Groups: php.notes 
Request: Send a blank email to php-notes+get-91893@lists.php.net to get a copy of this message
I find that you need to open your ob for it to print . Heres my example that works in IE . Yes - the strings need to be long for it to flush ... ob_start(); for($i = 1; $i <= 10; $i++){ $sourceName = 'filetoupload' . $i; $imageArray = array(); if(!is_uploaded_file($_FILES[$sourceName]['tmp_name'])) { $imageArray[$num-1] = NULL; $message="Image $i does not exist (has not been prompted for upload)<br/>"; } else { move_uploaded_file($_FILES[$sourceName]['tmp_name'], "temporary/$sourceName"); $message = "Image $i has been uploaded to the server"; } echo $message; flush(); ob_flush(); usleep(300); } ob_end_flush(); ---- Manual Page -- http://www.php.net/manual/en/function.flush.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54713 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54713&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54713&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54713&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54713&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54713&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54713&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54713&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91893) next »