note 52514 deleted from function.header by tularis

From: Date: Fri, 20 Apr 2007 14:46:52 +0000
Subject: note 52514 deleted from function.header by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-125666@lists.php.net to get a copy of this message
Note Submitter: TJ ---- I had made a download script for a client that would just register the number of times a document had been downloaded in a database. When using headers and the readfile()-function to pass the file through the browser I got some weird errors with half of the powerpoint files I tried to download. My solution: - Register the hitcount in the database - Instead of using headers and readfile, forward the user to the file he/she originally requested by using the following code: header("HTTP/1.0 307 Temporary redirect"); echo header("Location: http://www.example.com/filename"); exit();

« previous php.notes (#125666) next »