Need a PHP script for converting URL to image

pe_es171

New Member
Messages
23
Reaction score
0
Points
0
Pls,can anyone provide the code for converting http url to image(with explanation)?
 

footballfun230

New Member
Messages
41
Reaction score
0
Points
0
Hellope_es171

Something like this.

Copy & paste the bold type below and change all in "red" to suit.


target="_blank" will open the image link in new window.
border="0" will show no border around outer image.
width="xxx" change the width of the image to suit.
height="xx" change the height of the image to suit.
Change, remove any or all above parts from the code below to suit.




<a href=" your url here " target="_blank"><img src=" image url here " alt=" ** PLEASE DESCRIBE THIS IMAGE ** " border="0" width="240" height="70"></a>



Good luck
Liz.

---------- Post added at 12:23 PM ---------- Previous post was at 12:11 PM ----------

Hellope_es171

Something like this for image in php?

$url = 'http://example.com/image.php';
$img = '/my/folder/flower.gif';
file_put_contents($img, file_get_contents($url));


$img_url = 'http://www.php.net/images/php.gif';
$b64_url = 'php://filter/read=convert.base64-encode/resource='.$img_url;
$b64_img = file_get_contents($b64_url);
echo $b64_img;


---------- Post added at 12:37 PM ---------- Previous post was at 12:23 PM ----------

<?php
echo "<a href=\" your url here \" target=\"_blank\"><img src=\" image url here \" alt=\" ** PLEASE DESCRIBE THIS IMAGE ** \" border=\"0\" width=\"240\" height=\"70\"></a>\n";
?>
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
You've already asked this; don't start another thread with the same topic when the first is still so recent (it might be another matter if the other thread was a few years old). essellar gave you a great answer; read what he wrote, work on understanding it and follow his advice. You're coming across as a help vampire.
 
Top