Hi there, I want to know the simplest way to upload an image in to the database using php and display it back to my web page.If any one has the simplest code then please share it with me.
PHP page allowing the image file to be uploaded to an uploads directory. (Ensure its a valid image file and not a shell script that could allow hackers backdoor access to your site).
Once image is validated as true image. Store location of image in database. (e.g. - "images/image_file_name.jpg")
then call it through the display.php page in the <img src="$img" />
(keep in mind you have to run an SQL query to fetch the image location with a unique ID and attach it to the variable called $img.