PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to get the width and height of a remote image. I would like to do this without generating the image in GD because the user can upload any image [ gif, png, jpg...]and I really don't feel like writing a case for each image [ if png use imagecreatepng ]
Where banner is a remote image link. Here is the error i receive:
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/toplist/register.php on line 144
Warning: file_get_contents(http://graphics.domain.com/link_banner/400x60.gif) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/toplist/register.php on line 144
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Empty string or invalid image in /var/www/toplist/register.php on line 145
Warning: imagesx(): supplied argument is not a valid Image resource in /var/www/toplist/register.php on line 146
Warning: imagesy(): supplied argument is not a valid Image resource in /var/www/toplist/register.php on line 147
I'm pretty sure it is because the website has hot link protection. This works for other images. I'm pretty sure this is [ SOLVED ] unless someone wants to tell me how I can get around the hot link protection.