-3
<?php
$type="student";
$paths="klm";
$a2="med";
$da="_";
$a23=$type.$da.$paths.$da.$a2;
$enpath=$type.'//'.$a23;
  

$folder_name=$enpath;
   if (!file_exists($output_dir . $folder_name))
            {
                @mkdir($output_dir . $folder_name, 0777,true); 
                echo "Folder Created";
            }
   

?>

xhello dev linux please fix my problem im using script php in server vps trying to creat folders look like this screen but when i search about those folders i cant find it the file.php in folder that this path: home/public/file.php and also in this path there student folder : home/public/student so i need to make child folder in student folder

Medz Ramy
  • 9
  • 1

1 Answers1

0

Your code is a bit tricky but looks like $output_dir is undefined so is null due to PHP default behavior. So you're trying to create student/student_klm_med dir, not a /home/public/student/student_klm_med or whatever. Note that mkdir() requires an absolute system path to create a directory.

Nick
  • 138,499
  • 22
  • 57
  • 95
  • 1
    It's against SO guidelines to include contact info in answers, this can be considered as spam with the intent of gettng work. – Nick Sep 16 '22 at 03:12
  • run the code to ways first is as a page in browser run normall but no folder created the scend way from terminal its run and maked the folder i wanna first way ? did u get my problem? – Medz Ramy Sep 16 '22 at 23:07