I'm trying to download an external image on my server with the variable that is written in the url, for example:
www.myserver.com/script.php/imageurl="https://www.otherserver.com/image.png"
for this I am trying to use the following PHP code:
1: header('Content-type: image/png');
2: $imageurl = $_GET['imageurl'];
3: $remote_image = file_get_contents($imageurl);
4: file_put_contents("/tmp/result.png", $remote_image);
The problem is obvious, the page returns an error because it can not find anything in the path specified in the url...
It's possible to accomplish this and "ignore" the url that comes after script.php/?