Now, I'm no coder, that's why I'm here. I have this small script, and I would like to be able to call an image, with html I can included with the image. So calling <img src=myscript.jpg>, which call on myscript.php. I have .htaccess set up like so:
Code: Select all
Redirect myscript.jpg http://www.mydomain.com/myscript.phpCode: Select all
<?php
define('DS', DIRECTORY_SEPARATOR);
define('WEBROOT', dirname(__FILE__).DS);
$image = WEBROOT.'test.jpg';
header('Content-Type: image/jpeg');
header('Content-Length: '.filesize($image));
readfile($image);
?>I hope I'm making myself clear. I guess it has something to do with the header Content-Type? Is there a way to split it to show html AND image?