<?
// Setting the title of the page
$title = "Create Folder";
// Include files
include "common.php";
include "$GLOBALS[lib_path]/filesys.inc";
include "$GLOBALS[lib_path]/design.inc";
//echo "blah<br>\n";
// Set the user navbars.
if(!$HTTP_COOKIE_VARS[login_active]) $nav_array = array(main);
elseif($os->num_rows("SELECT user_name FROM users WHERE user_name='$session_array[user_name]' AND user_type='1'")) $nav_array = array_merge($GLOBALS[admin_navbox_array], $os->get_navbox_array($session_array[user_name]));
else $nav_array = array_merge($GLOBALS[basic_navbox_array], $os->get_navbox_array($session_array[user_name]));
// Decode the url encoding.
$rr_path = stripslashes(rawurldecode($r_path));
$rr_song = stripslashes(rawurldecode($song));
// Prep the data for export to the next cursed page.
$ss_path = rawurlencode($rr_path);
// The hidden part of the path
$p_path = "$GLOBALS[audio_folder]/$session_array[user_name]";
//echo "p_path = $p_path<br>\n";
// Combine the hidden path with the relitive path.
$w_path = FILESYS::create_path($p_path, $rr_path);
$GLOBALS[contents00] = <<<ENDcontents00
<form method="post" action="$PHP_SELF">
<table cellpadding="5" cellspacing="1" border="0"><tr bgcolor="dddddd">
<td>NAME: </td>
<td><input type="text" name="new_dir" value=""></td>
<td>
<input type="hidden" name="id" value="$id">
<input type="hidden" name="redirect" value="$HTTP_POST_VARS[redirect]">
<input type="hidden" name="r_path" value="$ss_path">
<input type="submit" value="create">
</td>
</tr></table>
</form>
ENDcontents00;
if($HTTP_POST_VARS[new_dir]){
$dir_path = $w_path . "/" . $HTTP_POST_VARS[new_dir];
if(mkdir("$dir_path", 0777)) header("Location: $url_path$HTTP_POST_VARS[redirect]?id=$id&r_path=$ss_path");
}
$contents = array("Create Folder"=>"$GLOBALS[contents00]");
draw_header("$title");
draw_nav($nav_array);
draw_sect($contents);
draw_footer();
ob_end_flush();
?>