Bill
80.***.***.***Reading and displaying images
There are situations where you'll want to use a PHP script as a controller and server of images, rather than serving the images directly. Here's a little GD lib PHP snippet that reads and displays an image. The script - when placed in a .php file and requested - works just as an image, except that you are free to add any code you want, such as water-marking, banning some types of user accounts from seeing some classifications of images, or what have you.PHP code:
<?php
header('Content-type: image/jpeg');
$image = imagecreatefromjpeg('path/to/image.jpg');
imagejpeg($image);
imagedestroy($image);
?>
This is the extreme basic code for displaying an image with GD lib, and you'll have to adapt it for your purpose and image types (I used Jpeg in the example).