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

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.


Send forgot password by mail or message ...
PHP MySQL simple login system...
Check for duplicate username live or ema...
How to create simple search engine using...
Diseño de sitio web CSS Layout...
Diseño de caja flexible CSS3...
Botones en CSS...
ID y Clase, Diferencias entre Class e Id...
Esquina redondeada CSS...
Tamaño de caja css box-sizing: border-b...
Alineación CSS...
Altura y Anchura CSS...
Bordes CSS...
Margen CSS...
Relleno CSS...
Modelo de caja CSS...
Tablas CSS...
Listas CSS...
Enlaces CSS...
Texto CSS...