RE: [PHP] Updating a table after a successful download

From: Date: Wed, 30 Jul 2003 13:40:35 +0000
Subject: RE: [PHP] Updating a table after a successful download
Groups: php.general 
Request: Send a blank email to php-general+get-157521@lists.php.net to get a copy of this message
I tried changing the code to: // send headers to browser to initiate file download header ("Content-Type: application/octet-stream"); header ("Content-Disposition: attachment; filename=$realname"); readfile($filename); if(connection_aborted()==0) { $query = "UPDATE $table_data SET status = '$SESSION_UID' WHERE id = '$id'"; $result=&$conn->Execute($query); } But it still doesn't work as expected. What am I doing wrong? thanks, Luis -----Original Message----- From: David Nicholson [mailto:me@djnicholson.com] Sent: Wednesday, July 30, 2003 8:18 AM To: Luis Lebron Cc: php-general@lists.php.net Subject: Re: [PHP] Updating a table after a successful download Hello, This is a reply to an e-mail that you wrote on Wed, 30 Jul 2003 at 13:46, lines prefixed by '>' were originally written by you. > The problem I am having is that when the download is canceled by the > user > the document still shows up as being checked out. Is there a way to > know if > the document has been successfully downloaded before I update the > database. The connection handling section of the manual may help you... http://uk.php.net/manual/en/features.connection-handling.php You could possibly use register_shutdown_function() and connection_aborted() to set the status back if the connection was cancelled. David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP)

« previous php.general (#157521) next »