CMPT 210

02/19/13

Home
CMPT 125
CMPT 110
CMPT 210
CMPT 260
Information
Photo Gallery

 

Welcome to Programming with PHP and MySQL on Apache!

bulletSyllabus      
bulletLab Sheet

 

Assignments

Lesson 1 - XAMPP

bulletIntroduction
bulletInstalling XAMPP
bulletTesting XAMPP
bulletWriting the First Script
bulletTesting the First Script

Read Lesson 1

Complete Lab 1

Lesson 2 - PHP Getting Started

What is PHP and How is it Parsed

bullet

    What can PHP Do?

bullet

    PHP Start and End Tags

bullet

    HTML and PHP

bullet

    The Terminator and Errors

bullet

     Escape Characters in PHP

bullet

     Commenting Your Code

     Read Lesson 2

     Complete Lab 2

     Lesson 3 - Variables

bullet

          How to Use PHP Variables

bullet

      How to Use PHP Operators

     Read Lesson 3

     Complete Lab 3

     Lesson 4

bullet

     Using Variables in an HTML Form

bullet

     Using Environment Variables

bullet

     Using PHP Functions

     Read Lesson 4

     Complete Lab 4

Task 1 - 2/13/2013 What you should know: Using POST, sending variables and calculating variables to a script.

Lesson 5  Challenge - See Lab 5

Lesson 6

bulletUsing the Copy()
bulletUsing the opendir()
bulletUsing the readdir()
bulletUsing str_word_count in HTML

Read Lesson 6

Complete Lab 6

Lesson 7

bullet

     Creating a user in phpMyAdmin

bullet

     Making a Connection

bullet

     Listing Databases

bullet

     Listing Tables

bullet

     Creating a Database

bullet

     Deleting a Database

       Read Lesson 7

     Complete Lab 7

     Lesson 8 - TBA -Study for Task 2

     Task 2 - 3/6/2013

       Read Lesson 9

     Complete Lab 9

     Lesson 10

bullet

     Adding records into a Table

bullet

     Talk about final project

bullet

     Design Document - Due 11/9/11

      Read Lesson 10

      Complete Lab 10

     Lesson 11

bullet

     Displaying records with SELECT command

bullet

     Using ORDER to sort results

bullet

     Using mysql_fetch_array()

     Read Lesson 11

     Complete Lab 11

     Lesson 12

bullet

      Login script

bullet

      password()

     Read Lesson 12

     Complete Lab 12

Lesson 13

bullet

      Relationships

bullet

      phpMyAdmin Designer

bullet

      SQL INNER and OUTER JOINS

Read Lesson 13

Complete Lab 13

Final Requirements

One design document - Due 4/24/2012

Must be a fully functioning web site with the following:

Menu options - administration,  login, add, edit and view information.

A MySQL Database with 2 or more tables with a relationship

Lab Assignments

Lab 1

  1. Install XAMPP on your USB Drive or Laptop for in class use
  2. Open and test your web server
  3. Get familiar with all of the options in XAMPP
  4. Visit all of the sites mentioned in the Lesson 1 document
  5. Create and test the first script

Lab 1b

Create the following scripts and have me sign off on them

  1. PHP Start and End Tags - phptags.php

  2. HTML and PHP - firstscript.php

  3. The Terminator and Errors - errorscript.php & errorscriptfixed.php

  4. Escape Characters in PHP - errorscript2.php & errorscript2fixed.php

  5. Commenting Your Code - comments.php

Lab 3

Create the following scripts and have me sign off on them

  1. Variables and variable Types - printvarscript.php

  2. Constants - constants.php

  3. Pre-Defined Constants - constants2.php

  4. Assignment Operators - assign.php

  5. Arithmetic Operators - arithmetic.php

  6. Comparison Operators - compare.php

  7. Logic Operators - logic.php

Lab 4

Create the following scripts and have me sign off on them

  1. HTML calculate form - calculate_form.html

  2. Create the calculate.php

  3. Research and fix all errors in the calculate.php

  4. Research line 4 in the bday.php and modify the script to print out all parameters to the screen.  Change and remove dates.

  5. Go to this link: http://www.w3schools.com/php/default.asp  look through the functions and find on that you want to know more about.  Create a script with the function you have selected.

LAB 5

Create a form similar to this one that will count the number of words and charge accordingly. Hint: Use str_word_count

Your result .php page should like this:

Lab 6

1.     Recreate the up_load form and script

2.   Using the opendir() and readdir() create a list that will display like the first list using <ul>.

 

Lab 7

1.     Recreate the connection script Research why a new user is denied access.  

2.     Recreate the listdb.php

3.     Recreate the listtables.php

4.     Recreating the Create database

5.  Recreate the Delete database

 

 Lab 8 - Study for Task 2 -TBA

Lab 9

1. Recreate all of the HTML and scripts in Lesson 9

Lab 10

1.  Recreate the HTML and script in Lesson 10.  Use your own fields!

Lab 11

This script can be improved on by passing in variables via POST on how you want the query ORDERED by.  So instead of having 4 different scripts you will only need one.

1.     1.  Modify the script to take an input for how the results will be ORDERED by.

2.     2.  Modify results to be shown in an HTML Table.

     Lab 12

     1.  Recreate the HTML Forms and Scripts in Lesson 12

 

        

      

 

;

 

 

Home | CMPT 125 | CMPT 110 | CMPT 210 | CMPT 260 | Information | Photo Gallery

This site was last updated 02/19/13