AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

How to create directory or folder with HTML button and PHP


PHP Tutorial » Create directory or folder

A new directory or folder can be created in PHP using mkdir() function. This PHP function takes a path to the directory or folder to be created.

Syntax:
mkdir( path, mode, recursive, context )


Create directory or folder using 0777 allows the specification of permissions on the directory - examples


Example: On this window you can edit online this script to create directory or folder with HTML button and PHP
Make a file named: create_folder.php and add next HTML, PHP script

<?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,
 (controlling such issues as whether the directory is writable): */
echo "<script type = 'text/javascript'>alert('Folder Created!');</script>";/* Success Message */
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Create folder with HTML button</title>
</head>

<body>
<form action="create_folder.php" method="post">
<h2> Create New Folder </h2>
Folder name to create
<input name="createfolder" type="text">
<input type="submit" value="Create Folder">
</form>
</body>
</html>





How to create directory with HTML button and PHP, create directory if it doesn't exist, with write permissions, with 777 permissions
How to create directory or folder with HTML button and PHP - php tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Home
PHP Introduction
PHP Install
PHP Syntax
PHP Variables
PHP Echo and Print
PHP Data Types
PHP String Function
PHP Constants
PHP Operator Types
PHP If Else and Elseif
PHP Switch
PHP While Loops
PHP Loop For Do Foreach
PHP Array
Convert Array to String
PHP Function
PHP GET and POST
PHP Date/Time Functions
PHP Login
PHP Delete Element
PHP eregi_replace()
PHP mysql_query()
PHP Errors to Display
PHP Loop For Do Foreach

PHP forms
PHP Form Example
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Upload Image, display, edit and delete i...
Login Form with Image background...
How to Create an Image with Transparent ...
Portfolio Gallery Website with filtering...
Simple pagination script PHP MySQLi...
Center Image in div...
Image Hover Overlay Fade...
Sticky image / element / div on scroll...
Responsive images...
Create rounded image in HTML CSS...
Add border around image...
Position Text Over an Image HTML CSS res...
Create a Slideshow Images Gallery...
Create a Sticky Sidebar...
Search bar using CSS HTML...
Shrink Navigation Menu on Scroll...
How to Create Accordion HTML Templates...
Dropdown menu in the navigation bar...
Responsive Top Navigation Bar with mobil...
Split horizontal navigation bar...