Sunday, March 8, 2015

Creating New Folder With PHP (Simple Tutorial)

Assalamu'alaikum Warohmatullohi Wabarokatuh.








Good Night All.
Today I will share simple tutorial about Creating New Folder With PHP.
Further to the steps.

Steps 1.
Your create new directory with name is "folder"

Steps 2.

Create new file html and save with name "form.html".

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="jual mainan anak, mainan anak lucu, mainan edukasi anak, dunia mainan murah, toko mainan bekasi, mainan murah bekasi, jual mainan murah, mainan anak murah, toko mainan murah, jual mainan bekasi" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Add New Folder</title>
</head>

<body>
<form action="folder_add.php" method="post">
    Folder Name :<br />
<input name="fname" type="text" placeholder="Input folder name" /><br />
<input name="submit" type="submit" value="Create Folder" />
<input name="clear" type="reset" value="Reload" />
    </form>
</body>
</html>

Steps 3.
Create new file php with name "folder_add.php"

<?php
$folder_name=$_POST['fname'];
$dir="folder";
    
    if ($folder_name!="") {
$create_folder=mkdir ("$dir/$folder_name"); //creating folder
if ($create_folder) {
echo "<script> alert('Folder Added Success!'); javascript:history.back(); </script>"; //if folder success added (pesan jika folder berhasil dibuat)
}else{
echo "<script> alert('Error added Folder!'); javascript:history.back(); </script>"; //error if folder not creat (jika folder gagal dibuat)
}
    }
else {
echo "<script> alert('No data form!'); javascript:history.back(); </script>"; //if form zero data (jika form kosong)
}
?>


And now you can add all folder.
This is a simple tutorial about creating new folder if you want more of this I will give everything I can with the comments that you submit.


Thanks to All visitor.
See you in the next tutorial.
Hope it can help you all.
Bye-bye.

1 comment:

  1. Keep blogging, and share any tutorial bro.
    I want follow your blog to my circle.

    ReplyDelete