CSY2028 – Internet Programming CGI Laboratory using JAVA and PHP Note: Remember that your JAVA and PHP scripts must be in your public_html area. Either use an editor, such as Windows Notepad, to create your scripts and then upload your scripts to your public_html area. You can upload using either Internet Explorer using ftp or using WinSCP. With WinSCP it is also possible to edit for scripts directly in your public_html area. Exercises 1. Upload and test last weeks three JAVA CGI scripts 2. Try getting the PHP scripts on Page 2, 10, 11, 17 and 18 on the OHP to work by entering them using a text editor and saving them in your public_html directory. You need to ensure that they have the permissions rw-r—r-- (0644). 3. The environment generated by the Apache web server is available to PHP shell as with all CGI. For example the variable REMOTE_ADDR , which gives the IP address of the browser which invoked the PHP script, can be displayed back to the browser by including the line echo “Your IP address is $REMOTE_ADDR” Create a PHP script which echoes back to the browser its remote address and which vendor and version of browser the user is using. 4. Using the code on Page 17 and 18 as a starting point, create a PHP which acts as a hit counter. To get the date in HP use the code : $today = date("F j, Y, g:i a"); echo $today; 5. Create a PHP script, which displays the log file created in (3). 6. Modify (3) so it not only logs the time and date but also includes the remote address and browser vendor and version. Verify that it works correctly by running(4). 7. Upload the colours2.php script to your area and get it to run. 8. Modify your colours2.php script so that it displays the same output as colours2b.php, colours3.php, colours3b.php and colours3c.php