Thursday 24 October 2019

PHP Form / File list

Form

https://www.w3schools.com/php/php_forms.asp


File list (index.php)

<?php

$dir    = '.';
$filesAsc = scandir($dir);
$filesDesc = scandir($dir1);



for ($x=0$x<count($filesAsc); $x++) {
    $str = "<br/><a href='%s'>%s</a><br/>";
    $fileName = $filesAsc[$x];
    $str2 = str_replace("%s"$fileName$str);
    echo $str2;
}

No comments:

Post a Comment