Welcome to WebmasterWorld Guest from 220.127.116.11
Just curious to know is it possible to create directories on the fly?
What I have done is created a script when you can add categories and subcategories, but what I would like to do is create a directory physcially within that category. For instance using the mkdir command using linux. In a way traversing through and creating a directory.
An example would be:
If I created a category called business and econony then it would display this in the address bar.
Then perhaps under Business and Economy, a category called Accounting, then it would display the following:
Hopefully I'm making some sense here.
Heres the code:
order by cat_name";
$display="<img src=http://www.domain.com/spacer.gif border=0 width=$width height=12>";
$display.="<input type=\"radio\" name=\"quest_type\" value=$DBcatid checked>";
$display.="<input type=\"radio\" name=\"quest_type\" value=$DBcatid>";
if ($submit=='Add New Category')
mysql_query("insert into quiz_category
(parentid,cat_name) values ($quest_type,'$new_cat')");
# need to create directory here
echo "<br><br><center><b>New category entered</b></center>";
echo "<br><br><center><b>New category name must be entered</b></center>";
This might be what you're looking for. In the user-contributed notes you can find functions for creating multiple directories.
Yeah I did look into that, obviously there are other file functions I need to look into.
The problem lies where I need to check if the directory exist for the top level category and then the subcategories beneath, and then create a directory if it does not exist.