PHP Classes

File: fetch_image_frm_db.php

Recommend this page to a friend!
  Classes of Anirban Nath   Secure Image Uploading and Resizing   fetch_image_frm_db.php   Download  
File: fetch_image_frm_db.php
Role: Auxiliary script
Content type: text/plain
Description: for fetching images from DB and responsible for dispalying to user
Class: Secure Image Uploading and Resizing
Validate and resize uploaded image files
Author: By
Last change:
Date: 13 years ago
Size: 415 bytes
 

Contents

Class file image Download
<?php
require('conn.php'); /*important, change in conn.php to your settings*/

$id=$_GET['pid'];

$query = "SELECT * FROM upload WHERE ID=$id";

$result=mysql_query($query) or die('Error, query failed'.mysql_error());
$row=mysql_fetch_array($result);

//imagecreatefromjpeg( $row['name']);
header("Content-type:image/jpeg");
stripslashes ($row['content']);

echo
$row['content'];

   
 
?>