Code:
<?php
$name = $_GET['name'];
$mimes = array
(
'jpg' => 'image/jpg',
'jpeg' => 'image/jpg',
'gif' => 'image/gif',
'png' => 'image/png'
);
$ext = strtolower(end(explode('.', $name)));
$file = 'img/'.$name;
$file = 'images/'.$name;
$file = 'upload/'.$name;
header('content-type: '. $mimes[$ext]);
header('content-disposition: inline; filename="'.$name.'";');
readfile($file);
?>
i am trying to use php to load up images instead of using direct links
example: img/file.png
i want: img.php?name=file.ext.
i also want it where when ppl try to save it it saves it as php instead of a image.