I really do not know any PHP but I’d love to do one simple thing:
I access a php page from within a <img src="/myhumbleimage.php" /> and I’d like to have an image returned from another URL.
I came up with:
<?php
header('Content-Type: image/png');
readfile('i' . rand(1,3) . '.png');
exit;
And it works:
Avatar selection http://vercas.webuda.com/img.php?.png
(Reload the page a few times!)
Check out readfile().
The basic idea is you send the appropriate MIME type headers (using header()) then deliver the file contents using
readfile().For example