You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4.5 Running the code.md 1.6KB

Based on information from documents

  • 4.4 Common gateway interface
  • 2.1 (Git) situational awareness

and with a XAMPP setup from

  • 4.1, 4.2, 4.3, 4.4

you should be able to clone (and pull for any subsequent update) the repository locally then point your browser to the web documents (HTML) or CGI scripts (PHP) on http://localhost. If you run into a hiccup feel free to e-mail me to ask for solutions: apocpublic@outlook.com

--

What to expect then? Well if you had cloned the repository to /var/www/html or wherever the server loads resources from you would have been greeted with our index.htm file (index.html, same thing, if the .htm version doesn’t work rename the file to index.html) showing you the page. Now how do we load our sample CSV file with the script in the ./src/ subdirectory?

In case you haven’t noticed, I’ve renamed index.htm -> index.php and written in a <?php ?> enclosed piece of script into the existing HTML,

<?php require './src/index.php'; ?>

What this did is it instructed the server reading the contents (see document 4.2 point #6) of the index.php file that “require ‘./src/index.php’;” is something it should pass along to the PHP interpreter, and the interpreter has then in turn read that instruction with “./src/index.php” as a parameter, combining the /var/www/html path with ./src/index.php getting “/var/www/html/src/index.php” as the path of a script required for our script to function, ensuring it getting loaded every time. The end result is the ./src/index.php code executed from ./index.php, the

file_get_contents

instruction finally loading the sample CSV contents into the frontpage.