Iv been looking for a download page in php,html what ever it doesnt matter as long as it works, trouble is i cant find a template for one at all, iv googled many times but not found the results i need.
//This is our size condition if ($uploaded_size > 350000) { echo "Your file is too large.<br>"; $ok=0; }
//This is our limit file type condition if ($uploaded_type =="text/php") { echo "No PHP files<br>"; $ok=0; }
//Here we check that $ok was not set to 0 by an error if ($ok==0) { Echo "Sorry your file was not uploaded"; }
//If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } } ?>
Then to read and list a directory
PHP Code:
<?
//define the path as relative $path = "/your/path/here/";
$handle = opendir($path) or die("Unable to open $path");
while ($file = readdir($handle)){
if($file!="." && $file!=".."){
echo "<a href='$file'>$file</a><br/>";
}
}
closedir($dir_handle);
?>
__________________ Please login or register to view this content. Registration is FREE
This helped me a lot oo. I was just about to code somethinf like this one any you saved a lot of time for me
__________________
Biggest source to Please login or register to view this content. Registration is FREE free.
Thousands of Please login or register to view this content. Registration is FREE links indexed by genre.
Please login or register to view this content. Registration is FREE source by genres.