<img src='http://www.mysite.com/img/111.jpg' />
how can I show it like this:
<img src='show.php?FileName=111.jpg' />
1. Make your links point to <img src='show.php?FileName=111.jpg' />
2. In show.php, try the following:
<?php
// This assumes all your images will be in "images/"
// It also prevents using ../ for security
$file = basename('images/' . $_GET['FileName']);
if (file_exists($file)) {
// You may need to use header() to send more headers,
// eg. Caching headers (A very good idea) find out more
// at http://www.mnot.net/cache_docs/ or use Fiddler to
// find out what headers are being sent to your browser:
// http://www.fiddlertool.com
header('Content-Type: image/jpeg');
passthru($file);
}
?>
--
Richard Heyes
+44 (0)844 801 1072
http://www.websupportsolutions.co.uk
Knowledge Base and HelpDesk software
that can cut the cost of online support
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php