new_folder.php 681 B

123456789101112131415161718192021222324252627
  1. <?php
  2. include '../auth.php';
  3. ?>
  4. <?php
  5. //New Folder Creation PHP
  6. $foldername = $_POST['name'];
  7. $storage = "storage/";
  8. //declare the PHP_VERSION_ID
  9. if (!defined('PHP_VERSION_ID')) {
  10. $version = explode('.', PHP_VERSION);
  11. define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
  12. }
  13. //check if PHP was higher than 7.4, if true then not using inith filename
  14. if(PHP_VERSION_ID >= 70404){
  15. if (file_exists($storage . $foldername . "/") == false){
  16. mkdir($storage . $foldername . "/", 0777);
  17. echo 'DONE';
  18. }
  19. }else{
  20. if (file_exists($storage . $foldername . "/") == false){
  21. mkdir($storage . bin2hex($foldername) . "/", 0777);
  22. echo 'DONE';
  23. }
  24. }
  25. ?>