Hi,
I have some html/css knowledge but php is essentially new to me..
I am trying to write (a simple I imagine) script that will allow a user to input a folder name and submit, the script then creating a folder in a location set in the script, set the permission to 0777 and then confirm that the folder was created..
I have spent the envening trying to do this but have got to the point where I really need some help and guidance from people who know what they are doing.. The code below is inserted into my page via an include.. needless to say it is not working. Would someone be kind enought to have a look at the code I have produced and point me in the right direction..
thanks
<form action="" method="post">
Enter your folder name <input type="text" name="name" />
<input type="submit" />
</form>
//does the dir already exist
<?php
$var = 'dir_exists';
$filename = '/guests/$name';
if (file_exists($filename)) {
$dir_exists = '1'
}
else {
$dir_exists = '0'
}
?>
//make dir
<?php
if (!isset($_POST['submit']) & $dir_exists=='0') {
$name =$_POST['name'];
mkdir("/guests/$name", 0777);
echo "Your folder was created";
}
else {
echo "The foldername already exists";
}
?>