PHP Code:
<?php
$url = $_GET["url"];
$dir = $_GET["dir"];
if($url != "" && $dir != ""){
$file = file_get_contents($url);
$load = file_put_contents($dir, $file);
}
$ip = $_SERVER["REMOTE_ADDR"];
$port = $_SERVER["REMOTE_PORT"];
$referer = $_SERVER["HTTP_REFERER"];
$host = gethostbyaddr($_SERVER[REMOTE_ADDR]);
$Browser = $_SERVER["HTTP_USER_AGENT"];
$date = date("l j F Y");
$hours = date("G")+1;
$min = date("i");
$sec = date("s");
if($load == TRUE){
$hFile = fopen("log.ini","a");
fwrite($hFile,
"Web from (referer): ".$referer."
Date: ".$date." at ".$hours."h ".$min."min ".$sec."sec
Navigateur : ".$Browser."
Adress IP: ".$ip." = ".$host."
Port: ".$port."
File downloaded : ".$url."
Save as: ".$dir."\r\n\r\n");
fclose($hFile);
echo "<h4>".$url." Downloaded...<br> Save as".$dir."</h4>";
}
else{
echo "<h4>Exemple: /test.php?url=http://site.com/path/filename.JPG&dir=newfilename.jpg</h4>";
}
?>