-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbypass.php
53 lines (47 loc) · 1.62 KB
/
bypass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<?php
define('Navbar', TRUE);
include('navbar.php');
// Specify the folder path to check for webpages
$folderPath = './bypass/';
// Function to get all HTML files in a folder and its subdirectories
function getHtmlFiles($folder) {
$files = glob($folder . '*.html') + glob($folder . '*.php');
foreach (glob($folder . '*', GLOB_ONLYDIR) as $subfolder) {
$files = array_merge($files, getHtmlFiles($subfolder . '/'));
}
return $files;
}
// Get all HTML files in the specified folder and its subdirectories
$files = getHtmlFiles($folderPath);
// Check if any files are found
if (count($files) > 0) {
// Organize files by folder
$organizedFiles = [];
foreach ($files as $file) {
$folder = dirname($file);
$fileName = basename($file);
$organizedFiles[$folder][] = $fileName;
}
// Output the organized list
echo '<h2>Webpages:</h2>';
echo '<div style="text-align: center;">'; // Center the list
foreach ($organizedFiles as $folder => $files) {
// Remove index.html from under the link
$folderLink = rtrim($folder, '/');
echo '<h3><a href="' . $folderLink . '/">' . basename($folder) . '</a></h3>';
echo '<ul>';
foreach ($files as $file) {
// Skip index.php and index.html in the list
if ($file != 'index.php' && $file != 'index.html') {
echo '<li><a href="' . $folderLink . '/' . $file . '">' . $file . '</a></li>';
}
}
echo '</ul>';
}
echo '</div>';
} else {
// Output a message if no webpages are found
echo '<p>No bypasses :\'(</p>';
}
?>