How To add username and password support in this script and also the downloaded file url show next page help plz
<html>
<head>
<title>Remote Upload Page</title>
<script>
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
</script>
</head>
<body>
<form method=post action="download.php" onSubmit="submitonce(this)">
<p align="center"><b><font face="Tahoma">Enter Download URL :</font></b></p>
<p align="center"> <input type="text" name="Link" size="50" dir="ltr">
<input type="submit" name="submit" value="Upload" dir="ltr"> </p>
</body>
</html>
download.php
<?php
define('BUFSIZ', 4095);
$url = $Link;
$dir = 'files/';
$rfile = fopen($url, 'r');
$lfile = fopen($dir . basename($url), 'w');
while(!feof($rfile))
fwrite($lfile, fread($rfile, BUFSIZ), BUFSIZ);
fclose($rfile);
fclose($lfile);
//echo '<p align="center"><b><font face="Tahoma" size="5" color="#339933">$dir&&File Remote Download Complete !</font></b></p>';
echo $dir
?>