Need a Website Or Web Application Or Any Help In Code , Contact Us: +91 9437911966 (Whatsapp), Note: Paid Service
Students Tutorial app relased. Download Now.

PHP create directory or folder in server

In this example i am going to explain how to create a directory using PHP and MySQLi .


<!DOCTYPE html>
<form action="CreateFolder.php" method="post">
        Create New Folder
    <input name="createfolder" type="text">
    <input type="submit" value="Create Folder">



<?php $folder_name=$_POST['createfolder']; if (!file_exists($output_dir . $folder_name))/* Check folder exists or not */ { @mkdir($output_dir . $folder_name, 0777);/* Create folder by using mkdir function */ echo "Folder Created";/* Success Message */ } ?>