RU beehive logo ITEC dept promo banner
ITEC 325
2015fall
ibarland

homelectsexamshws
D2Lbreeze (snow day)

running-php-on-rucs
including files
running on rucs: file-protections

splitting into multiple files

We can take blend.php (src), and separate the code from the test-cases: utils.php (src), and separately utils-test.php (src). The directive require-once is a run-time instruction which just goes to the require'd file and (effectively) splices it into the current file, and continues evaluating line-by-line. (So it's reminiscent of java's import, but require-once significantly more simple-minded. Beware trampling on identifiers, and it's poor practice to have any dangling tags / code in the require'd file.)

This also lets us separate a program that uses blend from the test cases: some-web-page.php (src), and some-web-page.php (output).


Linux Review

You'll want to be familiar with the main options for the following:

Accessing rucs

Before we even revisit the code, let's talk about rucs (“radford university computer science”; it's a machine managed by the ITEC department, not the campus IT division):


Running a php file via the web

Note:We won't demo this in class yet, since it is not required for hw01. (And hw01 doesn't do this because it's important to be able to run your php programs without using the web at all, for debugging purposes.)

Recall that when a web-server gets a request, it decides how to respond. For php.radford.edu, some of the configuration rules:

Let's put our php program on the web!


XHTML

xhtml: Even though original HTML doesn't require the following, they are best practices, and they are required for this class:

See also:

homelectsexamshws
D2Lbreeze (snow day)


©2015, Ian Barland, Radford University
Last modified 2015.Nov.10 (Tue)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.