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;
}

PHP Start

PHP Start 


cd /etc/apache2/ 
sudo chmod 777 httpd.conf 

How to restart Apache web server on Mac OS 


sudo apachectl start 

cd /Library/WebServer/Documents 



 

 

Download visual studio code for Mac 
Php version on my mac
Ins-MacBook-Pro:bin inheeoh$ php -v
PHP 7.3.11 (cli) (built: Dec 13 2019 19:21:21) ( NTS )
Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies