added premium promotion, dropmail.php, dropattach.php, minor update of other files

This commit is contained in:
Gitea
2025-05-08 05:46:00 +05:30
parent b24bf3d1f6
commit f8ce844625
10 changed files with 187 additions and 12 deletions

41
dropattach.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
function deleteFiles($dir) {
// Open the directory
if ($handle = opendir($dir)) {
// Loop through each file in the directory
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$filePath = $dir . DIRECTORY_SEPARATOR . $file;
// If it's a directory, recursively call deleteFiles
if (is_dir($filePath)) {
deleteFiles($filePath);
} else {
// It's a file, attempt to delete it
if (unlink($filePath)) {
echo "File '$file' deleted successfully.<br>";
} else {
echo "Error deleting file '$file'.<br>";
}
}
}
}
// Close the directory handle
closedir($handle);
// Attempt to remove the directory itself
if (rmdir($dir)) {
echo "Directory '$dir' deleted successfully.<br>";
} else {
echo "Error deleting directory '$dir'.<br>";
}
}
}
$folderPath = '/home/u146541135/domains/zemail.me/public_html/public/tmp/attachments/';
// Ensure the folder path exists and is a directory
if (is_dir($folderPath)) {
deleteFiles($folderPath);
} else {
echo "Folder '$folderPath' does not exist or is not a directory.";
}
?>