BB5104 BB6205 Web Development for Business
Module Handbook bb5104-wdfb-module-handbook-1617
Information about the assessment on this module is here
Week One
Lecture slides lecture 1
Those students who wish to install WAMP (PC) or MAMP (Mac) can follow these instructions – although you should note that we will not be using the database parts till later on in the course
Week Two
Exercises: Exercises1
Exercise on creating Web forms in HTML: Exercise2
Week Three
Start with the lecture slides on forms and response pages: lecture handout
Form and response page developed in class: form-and-response
Next: lecture slides on If statements: lecture slides – Note that the Switch and Array material will be covered next week
There are PHP Exercises
Webscriptingform1 (this is required for the exercises – you need to extract the content from the zip file)
form exercise (two files in a zip) – extract them into a folder
Week Four
Start with the test (detailed here)
lecture slides used in the lecture and filesforlecture in a zip file
Lab Exercises PHP Exercises
Code for Lab Exercises form for exercises
Week Five
Materials on PHP
lecture slides on And, Or, for loops and indexed arrays
Lab Exercises PHP Exercises
Code for Lab Exercises lab files
[Enrichment Activity Week]
Week Six
lecture on associative arrays, while loops and databases lecture-6
Exercises on functions, arrays and loops php-exercises
Materials on Databases
There are notes on setting up MAMP (Mac OS X) and XAMPP (Windows) on your own machines Installing and using MAMP Installing and using XAMPP.
If you will be using the mySQL server on studentnet, look at the instructions in SQL Session 1 to see how to set it up
This empDB.sql contains create and insert statements that can be used to create the EMP, DEPT and GRADE table
There are notes (adapted from ones used in the first year) on using SQL in mySQL:
Starting with SQL – projection SQL Session 1
Selection in SQL SQL Session 2
There are notes (adapted from ones used in the first year) on using SQL in mySQL:
Joining tables SQL Session 3
Creating tables SQL Session 4
Functions, grouping and subqueries SQL Session 5
You should try the exercises in the SQL sessions above to revise the SQL syntax – the relational algebra material won’t be used this year, but will be relevant if you wish to study Database Systems at level 6
NOTE: You do NOT have to include the exercises for SQL in your portfolio of work!
Week Seven
Databases – embedding SQL in PHP with built in functions lecture-7
These lines of SQL may be cut and pasted to set up a table and sample data
create table student(kuid char(255), lastname char(255), money int)
insert into student (kuid,lastname,money) values (“k1200012”, “SMITH”, 45);
insert into student (kuid,lastname,money) values (“k1243012”, “AVERY”, 22);
insert into student (kuid,lastname,money) values (“k1230012”, “MITCHELL”, 26);
insert into student (kuid,lastname,money) values (“k1034512”, “WEBB”, 22);
insert into student (kuid,lastname,money) values (“k1000012”, “TENNENT”, 22);
insert into student (kuid,lastname,money) values (“k1219912”, “RUSSELL”, 10);
Sample PHP connect to DB code – there are different versions depending on whether you are using the KU provided studentnet, or your own laptop. Unzip the files, then edit to include your details at the top (remove the comment // at the top of the file where the variables are declared)
Use this if using KU-studentnet: databaseexampleku-php
The latest version of MAMP/XAMPP has changed to using the mysqli versions of the database connectivity functions – these require a few extra parameters embedded inside the functions. This code should work…
Use this if using your own Mac/PC with MAMP/XAMPP:
Code for PHP select example databaseexample
Exercises: php-exercises
Week Eight
The EMP, GRADE and DEPT table are required for the CRUD example empDB.sql
Introduction to CRUD
Example Retrieve code (the R in CRUD, using an SQL select statement)
Code for delete operation: empdelete
Week Nine – 1st December
CRUD Part Two: finishing the CRUD example continued from Week Eight
Code for emp insert: empinsert
Code for emp update: empupdate
Working code for empUpdate (note – studentnet version): empupdateworking
Exercise for this week: php-exercises
Week Ten
There is no class this week, so students should focus on getting the core of the assignment done – I will be available to look at your assignment in week 11, so it’s important to spend some time attempting the coursework before next week.
Week Eleven
Slides on functions: functions
Exercises: php-exercises
END Teaching Period 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Old material
Authenticated sessions – slides authenticated sessions
Authentication code: authentication
This SQL can be used to create the user table required (with one record) – if using copy and paste carefully check the double quotes
create table if not exists user (
userno int,
username VARCHAR( 40 ),
password VARCHAR( 40 )
) ENGINE = InnoDB;
insert into user (userno,username,password) values (1,”user1″, “qwerty”);
Here is the complete code from class: Working version
We will also be advising on the assignment.
Teaching Period 2
The following guides may be if you wish to install a debugger / Netbeans on your OWN laptop. Note that both of these guides assume that you have a working version of XAMPP/MAMP installed, which has been configured to use a folder called PHP in your documents folder.
Installing Netbeans on windows with XAMMP Installing and using XAMPP with Netbeans
Installing Netbeans on a mac with MAMP Installing and using MAMP with Netbeans
Here is the list of recommended reading for teaching block 2. These links were generated Jan 2015 – if they stop working, use the library search function
- PHP for dummies, Janet Valede, Chapter 9, library link
- Learning PHP, mySQL and Javascript, Robin Nixon, Chapter 5, library link
- Beginning PHP and mySQL, W Jason Gilmore, Chapter 6 and 7, library link
- Learning UML 2.0, Russ Miles, Chapter 4,5 and 7, library link
- UML Toolkit, Hand-Erik Erikkson, Chapter 4 and 5 – sequence diagrams, library link
Week One
PHP review, using functions
Slides: WDB1516TB2 WK 01
This folder contains some material on basic PHP and functions – look for the Week 01 PDFs
Week Two
Creating functions, classes and objects – basic classes and then creating objects to use those shapes
Slides: WDB1516TB2 week 2
This folder contains some material on functions in PHP – look for the Week 02 PDFs
Week Three
Creating a fraction class from functions. Using a fraction object, using a constructor.
Slides from class: Slides
Examples developed in class: examples from class
This folder contains some material on functions and constructors in PHP – look for the Week 03 PDFs
Week Four
Test followed by the two fractions code developed in class
Here is a zip file containing the code (two files which need to be extracted and placed in the same folder): fractions
Week Five
Developing a FractionArray class (containing an array of Fraction objects)
Developing an Improper Fraction class, demonstrating inheritance
Code for this week: FractionArrayCode
Slides for this week: Fraction week 05
This folder contains some material on constructors and inheritance in PHP – look for the Week 05 PDFs
[Reading Week]
Week Six
Creating a Name class (containing title, firstname, surname)
Creating a DOB class (containing a date of birth and a function that generates the age calculated from the DOB and todays date)
Creating a Person class, using both the Name and DOB classes in a composition relationship
Inheritance, public private visibility indicators
Slides: Week 06 slides
Code for this week: Code
This folder contains some material on constructors and inheritance in PHP – look for the Week 06 PDFs
Week Seven (3/3/16)
Code developed in class: Code
Slides: Week 07 slides
This folder contains some material on UML – look for the Week 07 PDFs
Week Eight
This folder contains some material on sequence diagrams in PHP – look for the Week 08 PDFs
Code developed in class: code
Diagrams developed in Dia: diagrams
Week Nine
Working on the assignment and feedback.
This site demonstrates top down and bottom up analysis for approaching class diagram construction
Dia can be downloaded from http://dia-installer.de and there are instructions for installing the PHP code generation plugin Installing the PHP plugin for DIA using uml2php5-2.1.zip