In PHP I am trying to make a new database type folder for different people on sign up and add files. I could easily create files and write to them but for some reason every time i try to have PHP create folders using the persons username variable as the path, all it does is create a folder named $username.
Here is my code cut down to the basics of that part.
<?php
$title = $_POST["title"];
$myFile = "/users/$username/title.txt";
$fh = fopen($myFile, 'w') or die("There was an error in changing your title. <br />");
$stringData = "$title\n";
fwrite($fh, $stringData);
fclose($fh);
$template = $_POST["temp"];
$myFile = "$structure/template.txt";
$fh = fopen($myFile, 'w') or die("There was an error in changing your template. <br />");
$stringData = "$template\n";
fwrite($fh, $stringData);
fclose($fh);
?>
$myFile = "/users/".$username."/title.txt";mkdir()function before. fr2.php.net/manual/en/function.mkdir.php