<?php
$directory = '/work/nginxstaticfile';  // Specify your folder path
$files = scandir($directory);        // Get all files in the directory
$htmlContent = '';                   // Initialize an empty string to store the HTML content

foreach ($files as $file) {
    // Exclude current (.) and parent (..) directory entries
    if ($file !== '.' && $file !== '..') {
        // Append the link for each file to the HTML content
        $htmlContent .= '<a href="'  . './' . $file . '" target="_blank">' . $file . '</a><br><br>';
    }
}
$directory = '/work/nginxstaticfile/co';  // Specify your folder path
$files = scandir($directory);        // Get all files in the directory
foreach ($files as $file) {
    // Exclude current (.) and parent (..) directory entries
    if ($file !== '.' && $file !== '..') {
        // Append the link for each file to the HTML content
        $htmlContent .= '<a href="'  . './co/' . $file . '" target="_blank">' . $file . '</a><br><br>';
    }
}

// Write the generated HTML content to a file named download.html
file_put_contents('index.html', $htmlContent);

echo "Links have been written to download.html";
?>
