Video Lesson 06

This semester our class will be running 1x per week, online. In order to make the most of our weekly meeting, and to prevent "Zoom Fatigue", I will be teaching the class using a "flipped classroom" model. Here's how this model will operate in our class this semester:

  • Before most classes you will be asked to watch a video lesson - the lesson for this week can be found below.
  • After you watch all of the videos in today's lesson you will have a small task to perform - we will refer to these as "micro assignments". These "micro" assignments are fairly straightforward and short and are directly related to the content covered in the video lesson for the week.
  • These "micro" assignments are due before our next class meeting. You cannot turn in a "micro" assignment late. We are setting up these assignments in this way so that everyone has a baseline level of knowledge of the topics being covered in the video lesson. This will allow us to make the most of our time together during our weekly course meeting.
  • During our course meeting we will cover new topics during the first half of class. During the second half of class we will focus on working on a larger programming assignment together and in small groups.

PHP Fundamentals

PHP CGI (GET and POST)

PHP Header Function

PHP Debugging Techniques

Bonus video: Sound in JavaScript

Bonus video: The Linux Command Line

Micro Assignment #06

Create two webpages - "micro06.php" and "micro06_process.php"

On "micro06.php" create a form that the user should fill out. This form should include blanks for them to type in a username and a password. When the user hits a submit button the data they entered into the form should be sent to "micro06_process.php" using the POST method.

When "micro06_process.php" receives this data it should respond in the following way:

  • If the user left the "username" field empty, the page should redirect back to the "micro06.php" page with a GET variable attached to it. This variable should inform the "micro06.php" page that the username was missing and an appropriate error message should appear.
  • If the user left the "password" field empty, the page should redirect back to the "micro06.php" page with a GET variable attached to it. This variable should inform the "micro06.php" page that the password was missing and an appropriate error message should appear.
  • If both the "username" and "password" fields are filled in but they do not match the correct username / password ("pikachu" / "pokemon") the browser should be redirected back to "micro06.php" with a GET variable attached to it. This variable should inform the "micro06.php" page that the username/password combo is incorrect and an appropriate error message should appear.
  • If both the "username" and "password" fields are filled in AND they are correct ("pikachu" / "pokemon" the browser should be redirected back to "micro06.php" with a GET variable attached. Some secret text should appear on the page at this point since the user can be considered "logged in" (note that this is NOT how we would do this on a "real" website, but it's a good demo to learn about the moving parts of a server-side application!)

When you are finished please upload a copy of this file to your i6 website using the process described in Assignment 01. Name your file micro06.php and ensure that it is accessible from within your webdev folder. You will also want to submit a link to your work on NYU Classes under the 'Assignments' tool. You will want to include this project as a link on your homepage (also described in Assignment 01)