File "code.php"

Full Path: /home/analogde/www/download/001/code.php
File size: 1.12 KB
MIME-type: text/html
Charset: utf-8

<!--
https://www.tutorialrepublic.com/php-tutorial/php-file-download.php
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <title>HTML Download Links</title>
</head>
<body>
    <p><a href="http://analog-design.net/Fusion/">Download Zip file</a></p>
    <p><a href="http://analog-design.net/Fusion/">Download PDF file</a></p>
    <p><a href="http://analog-design.net/Fusion/">Download Image file</a></p>
</body>
</html>

<?php


    $root = realpath($_SERVER["DOCUMENT_ROOT"]);
    echo " ++++ ".$root;
    echo "<br>";
    echo "<br>";

    $files = array("Electronics.ppt", "bidon.pptx");
    
    // Loop through array to create image gallery
    foreach($files as $element)
    {
        //echo '<div class="img-box">';
        //    echo '<img src="/examples/images/' . $image . '" width="200" alt="' .  pathinfo($image, PATHINFO_FILENAME) .'">';
        //    echo '<p><a href="http://analog-design.net/Fusion/?file=' . urlencode($image) . '">Download</a></p>';
        
            echo '<p><a href="download.php?file=' . urlencode($element) . '">Download</a></p>';
            //echo '</div>';
    }

?>