\n"; echo "\n"; $path = $_REQUEST['path']; $name = $_REQUEST['name']; exec('rm playlist/*'); exec('ln -s ' .addcslashes(quotemeta($path), " &'") .'* playlist'); $dir_handle = @opendir($path); if (!$dir_handle) echo "error"; else { while ($medianame = readdir($dir_handle)) if (mediagettype($path .$medianame) == 2) $medianame_array[] = $medianame; if ($medianame_array[0]) { // Alphabetical sorting sort($medianame_array); $plfile = fopen("playlist/playlist.m3u", 'w'); if (!$plfile) echo "error"; else { $count = count($medianame_array); $found = 0; for ($cnt=0; $cnt < $count; $cnt++) { if ($medianame_array[$cnt] == $name) $found=1; if ($found) fwrite($plfile,$httppath . "playlist/" .$medianame_array[$cnt] ."\n"); } fclose($plfile); echo "ok\n"; } } else echo "error"; } echo "\n"; ?>