Page 1 of 1

How to give a php link to image source (<img src=)

Posted: Thu Nov 11, 2010 5:23 pm
by Saman
First we need to make the php page. Name it as test.php.

Code: Select all

<?PHP
$image = imagecreatefromstring(file_get_contents("http://yoururl.com/img.jpg"));
header('Content-Type: image/png');
imagepng($image);
imagedestroy($image);
?>
now we can provide the php page as img source as below.

Code: Select all

<html>
<body>
<img src="test.php">
</body>
</html>
 

Re: How to give a php link to image source (<img src=)

Posted: Tue Mar 01, 2011 2:39 pm
by Pansophic
nice script over there, didn't knew about this.