Lesson 7: php programming, 2

 Signed in as:    
      Sign out



Your home page

Advanced Websites
   Layout and design
   Page framing
   Server Side Includes
   Introduction to CGI
   Introduction to php
   php: 'if', emails
   php: string handling and date / time
   php: file handling
   Responsive Web Design
   Processing images
   php: databases
   php: logins and passwords
   Tracking hits
   Navigation I
   Navigation II

Here we explore a bit more about the php programming language. Topics include:



Note: I strongly suggest you view all our videos in full screen mode: click the icon in the lower right corner of the video area (it shows four arrows pointing to the corners of the screen). When you are done, the Esc ("escape") key returns you to regular mode.


Lesson 07, part 1
More php: comparisons, 'if', and emails

Click here for the video transcript


Hands on exercise

This exercise is focused on coding 'if' statements, sending emails, and accessing the $_SERVER variables.

This exercise builds on your previous cgi, Feedback.php


Session 2
Complex 'if' statements


Here we explore logical operators and nested 'if' statements:



Lesson 07, part 2
Logical operators

Click here for the video transcript.


Hands on exercise

This exercise is primarily focused on setting up a new CGI that will implement nested 'if' statements in the next exercise.

The Table 'N' Fable club has organized a trip to visit locations in Wales named in the mystery novel "Welsh Rarebit Gone".

In lesson 4's lab, you constructed the HTML page 'signUp.shtml', which includes a form that invokes a CGI named 'AddTraveler.php' in your 'cgis' directory.

So in this exercise you will code cgis/AddTraveler.php - a new CGI

Here are steps to construct your first cut at AddTraveler.php:

Test your sign up form / cgi combination: verify you get the email as expected and the user sees the feedback page.


Session 3


Here we explore displaying addresses on a website, along with another opportunity to use nested if's.



Lesson 07, part 3

Click here for the video transcript.

Hands on exercise

This exercise is primarily focused using complex 'if' statements to construct a correctly formatted street address, based on what data the user has supplied. It modifies your new AddTraveler.php code.

In this exercise you will extend cgis/AddTraveler.php - your new CGI

Here are steps to update AddTraveler.php:

Save your updated AddTraveler.php and test it out, especially the formatting of addresses.


Supplemental materials

    A cumulative summary of the contents of this course so far: Click here
    For a combined cumulative summary of both Web courses so far, Click here


 Lesson navigation 



Email us if you would like additional information. We would love to see your comments and recommendations for our site.