Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST['hidden']) {
- $key = "../g_test/uploads";
- $new_folder = $_POST['nazevS'];
- $new_dir_path = $key."/".$new_folder;
- $dir = mkdir($new_dir_path);
- if($dir)
- chmod ($new_dir_path, 0777);
- }
- if ($_POST['hiddenSS']) {
- $key = "../g_test/uploads";
- $new_folder = $_POST['nazevS'];
- rmdir($key."/".$new_folder);
- }
- ?>
- Warning: rmdir(../g_test/uploads/) [function.rmdir]: Permission denied in /home/free/howto.cz/m/mousemys/root/www/g_test/upload.php on line 51
- $new_folder = $_POST['nazevS'];
- $new_dir_path = $key."/".$new_folder;
- $hd = opendir($mydir);
- closedir($hd);
- function force_rmdir($path) {
- if (!file_exists($path)) return false;
- if (is_file($path) || is_link($path)) {
- return unlink($path);
- }
- if (is_dir($path)) {
- $path = rtrim($path, DIR_SEPARATOR) . DIR_SEPARATOR;
- $result = true;
- $dir = new DirectoryIterator($path);
- foreach ($dir as $file) {
- if (!$file->isDot()) {
- $result &= force_rmdir($path . $file->getFilename(), false, $sizeErased);
- }
- }
- $result &= rmdir($path);
- return $result;
- }
- }
- chmod ug+rw /home/free/howto.cz/m/mousemys/root/www/g_test/
- sudo chmod ug+rw /home/free/howto.cz/m/mousemys/root/www/g_test/
- chgrp -R www-data g_test/uploads
- chmod g+w g_test/uploads
Add Comment
Please, Sign In to add comment