This is a easy way to create a directory which can be edited and put into upload scripts ect anyway
PHP Code:
<?php
if($_POST[submit]){ // Sees if the form has been submitted
$form = $_POST['directory']; // Gets the field from the form
$directory = $_SERVER['DOCUMENT_ROOT'] . "/" . $form; // Asks where the directory is going to be created
if (!is_dir($directory)) // Checks if the directory is already created
{
mkdir($directory, 0777); // Creates the directory and chmods it to 777
}
}
?>
<form method="POST">
<p><input type="text" name="directory" size="20" value="Directory Name"><input type="submit" value="Submit" name="submit"></p>
</form>
This has been tested and does work but if you are having problems with it saying something like
Quote:
|
Warning: mkdir(/home/****/public_html/Test) [function.mkdir]: Permission denied in /home/****/public_html/create.php on line 7
|
Then just go back to public_html and then change the permissions to 777 then it should work if its still not working please email me or pm me.
Thanks to Peterk92