PHP Downloader script ===================== Public domain ******************************************************************************** history.forward();\n"); echo("
"); logout(); login(); if(isset($_POST['url']) && $_POST['url'] != "") if(is_writable($download_dir)) { $url=$_POST['url']; $filename=$url; while(strpos($filename,"/") !== FALSE && substr($filename,strpos($filename,"/")+1) != "" ) { $filename=substr($filename,strpos($filename,"/")+1); } $filename="$download_dir/$filename"; echo "Downloading $filename from $url . . . "; if (!$handle = fopen($filename, 'a')) { echo "Cannot open ($filename)"; } else { if(fwrite($handle,file_get_contents($url)) === FALSE) { echo "Cannot write to ($filename)"; } else echo "Success"; fclose($handle); } } else echo "$download_dir directory is not writable !!!"; ?>$errorMessage
"; exit; } } function logout() { if( isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "" && $_SERVER['QUERY_STRING'] == "logout" ) { if (isset($_SESSION['admin_is_logged_in'])) { unset($_SESSION['admin_is_logged_in']); } } } ////////////////////////////////////////////////// ?> ******************************************************************************** _BY: Pejman Moghadam_ _TAG: php_ _DATE: 2012-01-18 13:52:39_