I have this script which cut my image in half fine, but when I change the filename to be http://www.mysecondsite.com/418.jpg I get the error below
How can I fix this?
<?php
// File and new size
$filename = '418.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);
?>
<br />
<b>Warning</b>: getimagesize(http://www.myfirstsite.com/travel/album/mid/418.jpg): failed to open stream: No route to host in <b>/home3/kiwis/public_html/thumb.php</b> on line <b>10</b><br />
<br />
<b>Warning</b>: imagecreatetruecolor(): Invalid image dimensions in <b>/home3/kiwis/public_html/thumb.php</b> on line <b>15</b><br />
<br />
<b>Warning</b>: imagecreatefromjpeg(http://www.myfirstsite.com/travel/album/mid/418.jpg): failed to open stream: No route to host in <b>/home3/kiwis/public_html/thumb.php</b> on line <b>16</b><br />
<br />
<b>Warning</b>: imagecopyresized(): supplied argument is not a valid Image resource in <b>/home3/kiwis/public_html/thumb.php</b> on line <b>19</b><br />
<br />
<b>Warning</b>: imagejpeg(): supplied argument is not a valid Image resource in <b>/home3/kiwis/public_html/thumb.php</b> on line <b>22</b><br />