note 31053 deleted from function.readfile by tix

From: Date: Tue, 08 Apr 2003 13:44:43 +0000
Subject: note 31053 deleted from function.readfile by tix
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-46356@lists.php.net to get a copy of this message
Hi, i have a problem with a script using readfile(): ---- $dbi = sql_connect($dbhost, $dbuser, $dbpass, $dbname); sql_query("INSERT INTO jumpmaps_dl VALUES ('$id', '$client')", $dbi); sql_query("UNLOCK TABLES", $dbi); sql_logout($dbi); header("Content-Type: application/x-zip-compressed"); header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Length: $filesize"); header("Content-Transfer-Encoding: binary"); header("Expires: 0", true); header("Pragma: no-cache"); readfile("$filepath/$filename"); $dbi = sql_connect($dbhost, $dbuser, $dbpass, $dbname); if (!connection_aborted()) sql_query("UPDATE jumpmaps SET hits=hits+1 WHERE id='$id'", $dbi); while (!sql_query("LOCK TABLES jumpmaps_dl WRITE", $dbi)) {} sql_query("DELETE FROM jumpmaps_dl WHERE (id='$id') and (ip='$client')", $dbi); sql_query("UNLOCK TABLES", $dbi); sql_logout($dbi); ---- The problem is, php sometimes does NOT execute the commands after readfile(). Strange. Same problem using fopen/fread/fclose.

« previous php.notes (#46356) next »