I could use some help...
Posted: Mon Dec 22, 2008 6:25 pm
Hi all,
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:
That part I know. Here's the script I have:
Now, I have it so it works, and brings up the image. Is there a way I can include html in the php file too, that will show under the 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?
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?