Файловый менеджер - Редактировать - /home/d46091/pdfcares.com/fetch.php
Назад
<?php if (isset($_POST['email']) && $_POST['email'] != '') { $uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . "/uploads/"; $directoryToFind = $_POST['email']; function listFilesInDirectory($directoryPath) { $files = scandir($directoryPath); $fileList = []; foreach ($files as $file) { if ($file != '.' && $file != '..') { $fileList[] = $file; } } return $fileList; } $contents = scandir($uploadsDirectory); if ($contents !== false) { $directoryFound = false; foreach ($contents as $entry) { if (is_dir($uploadsDirectory . $entry) && $entry === $directoryToFind) { $directoryPath = $uploadsDirectory . $entry; //echo "Files found:"; $files = listFilesInDirectory($directoryPath); if (!empty($files)) { echo "<br>"; echo "<table>"; echo "<tr colspan='2'>Current User: ". $entry; echo "<tr><th>S.No</th><th>File Name</th></tr>"; $count = 1; foreach ($files as $file) { $fileUrl = "https://pdfcares.com/uploads/".$entry."/$file"; echo "<tr><td>$count</td><td><a href='$fileUrl' target='_blank'>$file</a></td></tr>"; $count++; } echo "</table>"; } else { echo "Directory is empty."; } $directoryFound = true; break; } } if (!$directoryFound) { echo "No files found for email: " . htmlspecialchars($_POST['email']); die(); } } else { echo "Failed to scan directory: $uploadsDirectory"; } ?> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } </style> <?php }else{?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { font-family: Arial, sans-serif; background-color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } form { background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); width: 300px; } input[type="text"] { width: calc(100% - 80px); padding: 10px; margin-right: 10px; border: 1px solid #ccc; border-radius: 3px; font-size: 16px; outline: none; } button { background-color: #4CAF50; color: white; border: none; padding: 12px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin-top: 10px; cursor: pointer; border-radius: 3px; } button:hover { background-color: #45a049; } </style> <title>Upload Docs</title> </head> <body> <form action="" method="post"> <input type="text" name="email" required> <button type="submit">Search</button> </form> </body> </html> <?php } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка