Uploading/Timing scripts

From: Date: Thu, 22 Feb 2001 10:42:24 +0000
Subject: Uploading/Timing scripts
Groups: php.general 
Request: Send a blank email to php-general+get-41122@lists.php.net to get a copy of this message
Hi, I wondered if anyone knew what would be the better method to use to see if a file has been sent/uploaded? method 1: if ($HTTP_POST_FILES['file']['name'] != "none" && $HTTP_POST_FILES['file'] != "") { method 2: if (@$fp = fopen($HTTP_POST_FILES['file']['tmp_name'],"r")) { method 2 seems to work better, and seeing as I have to open the file on the next line testing to see if its there seemed the better way to do it? How can I find out how long my scripts take to execute? I'm currently using.. $stimer = timer(); // code ...... $etimer = timer(); echo "\n\nPage processed in: ". ($etimer-$stimer); Function timer() { $milli = explode(" ", microtime()); return $milli[0]; } Which works but is their a better way to do it? Thanks, Matt

« previous php.general (#41122) next »