RE: [PHP-DB] storing images in database

From: Date: Wed, 26 Jan 2005 14:20:04 +0000
Subject: RE: [PHP-DB] storing images in database
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38360@lists.php.net to get a copy of this message
Yes, I totally agree. This was merely a sample code of how it could be done. Not a definitive code samples of how to do it securely. There should be way more validation, and better error handling too. Bastien
From: Gareth Heyes <gareth@ignited.co.uk> To: php-db@lists.php.net CC: bastien_k@hotmail.com Subject: RE: [PHP-DB] storing images in database Date: Wed, 26 Jan 2005 13:30:45 +0000
if(isset($_GET['id'])) { $id=$_GET['id']; $query = "select bin_data, filetype from binary_data where id=$id";
This is a really bad example, anybody can inject your query with malicious sql commands. Never trust user supplied data.


« previous php.db (#38360) next »