Home > Backend Development > PHP Tutorial > Homemade super simple PHP network hard disk

Homemade super simple PHP network hard disk

WBOY
Release: 2016-07-25 09:04:59
Original
1168 people have browsed it

PHP+HTML混写的超简易网络硬盘

  1. disk online
  2. /*
  3. * code written by mot
  4. * 2012 - 5 - 20
  5. *在根目录下面新建一个 名字为 x 的文件夹 存放上传文件
  6. */
  7. if(isset($_REQUEST['del'])){
  8. unlink($_REQUEST['del']);
  9. }
  10. set_time_limit(0);
  11. if(isset($_POST['button']))
  12. if(isset($_FILES['file'])){
  13. move_uploaded_file($_FILES['file']['tmp_name'], ".\x\".$_FILES['file']['name']);
  14. }
  15. ?>
  16. File

  17. value="上传" />

  18. $hl = opendir(".\x\");
  19. while(false != $info = readdir($hl)){
  20. if($info == '.' || $info == '..') continue;
  21. $x[] = $info;
  22. }
  23. if(isset($x))
  24. foreach ($x as $file) {
  25. $type = explode('.', $file);
  26. $name = $type[0];
  27. $type = $type[1];
  28. $size = sprintf("%.2f",abs(filesize(".\x\".$file))/1024/1024);
  29. ?>
  30. }
  31. ?>
  32. 文件名 类型 MD5 大小 操作
    ">remove
复制代码


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template