CSC455

Fall 2009

Lab 16  PHP 1

 

 

You should have a public_html folder on otherone (otherone.cis.uncw.edu) which is can be used for web hosting

Use any FTP client such as Filezilla to connect. (Use Port 22 for a secure connection)

Set the permissions on the directory to 755. (From terminal client: chmod –R 755 ~/public_html/)

You may also need to do this for any new file you upload.

 

Create a simple test page called test.php, putting in your name instead of mine:

 

<html>

<body>

Testing HTML <br>

<?php

echo "Testing PHP <br>";

$myname = "MFerner";

echo "Test page for" , $myname;

?>

</body>

</html>

 

Upload it to your public_html directory on otherone.

 

Open a browser and check the page using your URL: http://otherone.cis.uncw.edu/~abc1234/test.php (substituting your userid)

 

Using the file employeelist.php as an example, create your own php page to query your company database to display the Project Name (Pname), Project Number (Pnumber) and Location (Plocation) for all projects.

 

Include your name somewhere using echo.

 

Upload and test it as in the previous steps.

 

Print the results of the query from the browser to hand in.

 

Challenge: Try to display the query results using an HTML table.