Quote:
Originally Posted by bluemoonballoon
I'm building a site for a client that has a feature similar to the way Facebook grabs images from a url you enter (ajax?). I've tried for days and I can't seem to find a simple way to get absolute image paths from a remote url. I can get the relative ones just fine, though.
Any thoughts? This is driving me nuts.
|
Get the address from the user inputed URL (such as
http://google.com) and append the relative image path (images/image.gif):
Code:
$url = $_GET['url'];
$image_path = "images/image.gif";
if(file_get_contents($url)){
$url += $image_path;
}
There's probably better ways of doing it, and of course you'd have to check to make sure there are no variables and such attached to the url.