Open main menu

CDOT Wiki β

Changes

OPS335 Lab 5

3 bytes removed, 13:19, 30 March 2016
no edit summary
<pre>Hello, this is a web page on vm4.yourid.org and the current time is Mar 28 22:16:27 EDT 2016!</pre>
<ol><li value="79">If you refresh your web-browser page in Firefox, you should see the contents of your ''index.html'' document. If you wish, you can specify the filename index.html in the address, but it is not necessary, since the file index.html is automatically loaded by default when the URL refers to that directory containing that file.</li></ol>
<pre>Hello, this is a web page on vm4.yourid.org and the current time is <?php system("date"); ?>!</pre>
the
<ol><li value="2">On your host machine, again refresh your web-browser. Notice that in a web browser the ''index.php'' file isn't treated as a default page and the contents don't contain the date, but instead are displaying the text in the php code you entered into the index.php file (refer to above code).</li><li>The reason this occurs is that the PHP interpreter hasn't been installed on your Centos vm4 by default.</li><li>Install the php packeage on your vm4 machine. NOTE: The php package comes with a working default Apache configuration so you don't need to enable it manually.</li><li>Refresh the webpage for your web-browser on your host machine. You should now notice that you see the date instead of the call to the date command. Refresh your webpage several times to see how the time changes. This is simply a "trivial example" of dynamic web content does it does provide a simple demonstration of how scripting languages can be used to create more dynamic webpages.</li></ol>
13,420
edits