Assignment: Getting Started with PHP

Your application will be a single index.php file with some elements in HTML and some elements in PHP. This also verifies that you can do basic HTML and know how to use the 'pre' tag as well as understand how to switch between PHP and HTML when writing a PHP script. Make sure to save your screen shots JPG or PNG files and keep them less than 1MB. You must include the URL bar in all of your screen shots and the software must be running in your PHP server (i.e. file:// urls will not be accepted)

You must run these files in your PHP server. Make a folder under your htdocs folder and then place your files in that file. The htdocs folder is in different locations depending on your web server:
XAMPP: c:\xampp\htdocs
MAMP:  /Applications/MAMP/htdocs
You can check the htdocs (a.k.a. DOCUMENT_ROOT) value for your server by scrolling down in your PHPInfo output. You may have changed a setting in your PHP server to move the DOCUMENT_ROOT to another location and that is OK as well.

Just make sure all the files are in a folder somewhere within DOCUMENT_ROOT and that all your testing uses localhost URLs like:

If you turn in screen shots with file:// in the URL you will get zero points for the assignment.

Sample solution

You can explore a sample solution for this problem at


There are several sources of information so you can do the assignment:

What To Hand In

For this assignment you will hand in:

  1. Image of your application showing the URL bar and the rest of the output.
  2. Image of your application showing the URL bar and output of fail.php
  3. Image of your application showing the URL bar output of check.php
  4. Source code of your index.php


Please do your reviews of the other students submissions carefully. The actual points you award are less important than useful comments about what might be wrong and need fixing. You cannot re-submit your assignment unless the instructor allows you to resubmit.

The total number of points for this assignment is 10. You will get up to 5 points from your instructor. You will get up to 3 points from your peers. You will get 1 for each peer assignment you assess. You need to grade a minimum of 2 peer assignments. You can grade up to 5 peer assignments if you like.

Sample Screen Shots

Provided by:

Copyright Creative Commons Attribution 3.0 - Charles R. Severance