Welcome > Module 2

Module 2


In order to develop extensively with PHP, you need to have a functional PHP webserver environment setup locally- that is, on your client machine. Most likely this will be the computer you do most of your work on. Having a webserver setup locally means you can test your programming with each save by loading the page from the webserver. Without this, you have to upload your files to the server, and then run the pages from there. For a portable webserver, you can install another copy that runs off a thumb drive- handy if you are switching machines a lot, or don't want to (or can't) install software on a computer.


Read Chapter 1 and 2 from the textbook. There will be textbook based quizzes in moodle for each chapter, and they'll account for about a third of your final grade.  Read the subsections of this module on this site. The include important instructions and details.


Install Local Webserver

Once you have the webserver running on your computer (either off your drive or off a thumb drive) you'll need to launch it and take a screenshot of the opening screen, where your instructor can see the words "localhost" in the URL, or - this effectively demonstrates you have installed it in a way you'll be able to use it. 

Run files on{ local Webserver

Take your files from the yetis site (or make a new one) and put them in the htdocs folder of your installed server2go or xampp site. If you put them in a folder called mystuff, the URL to go to (make sure the server is turned on) will be localhost/mystuff/ - On xampp you need to start the service. On server2go, run the server2go application and it'll open something like - so add /mystuff to that.

Take a partial screenshot that shows the top of your page and include the localhost URL ( is the same as localhost) and attach it to this forum to show that you've done it. Congratulations! You're now running a php file with html and css from a local webserver! 

And if you're not, ask questions on the discussion forum!

Loop your name

Make a new php page, or make a copy of one you have already and incorporate a for loop that repeats your name between 50 and 1000 times.  The for loop looks something like this:

for ($i = 0; $ i < 100; $ i++)
   echo ("<h2>Yo! My name is Bladiblad theImpaler von DurchsenHoss. Fear me!</h2>");

(you'll need to make sure this code makes sense, and fix if it doesn't. )
Also, search this site for valid html 5 code, and make sure your page is valid html 5. Easiest way is to copy the sample code, and include your php within that. Then drop the whole file into the htdocs folder of your local webserver. Make sure to run the webserver, name your file as .php and navigate to it (i.e. http://localhost/myfiles/thisassignment.php  ). 

To turn this in, take a picture of the page running on your local webserver (as always crop and cleanup so you don't turn in a massive image- just what you need to show it's done, and on your sever). Then upload the file to our webspace (yetis, as of this writing) and test it there, and provide a public link to that page there.

Valid HTML 5

Under resources get the code for html 5, then edit it according to your theme, and when you're happy with it, upload it to the sever and provide a direct link. Before submitting it, you'll need to click the validation button at the bottom, and make sure you get a green validation success- with only one warning. From this point on all your pages must validate to html 5 unless you provide a written explanation within the document as to why it doesn't (in which case it should validate to xhtml and have the appropriate button for that).

Your Theme

You'll need a theme for some of your project work and assignments. Ideally you'll choose something that you are passionate about and know enough about to come up with examples without too much thought. It can relate to your industry, or a field you've worked in, or a hobby or sport- something that has unique rules/terminology/imagery, etc... From this point on all your examples should incorporate that theme. When in doubt, go to flickr and start randomly looking at photos until something sparks your interest.