Help:COAP-3180/week4: Difference between revisions
m (→Homework 4) |
|||
Line 147: | Line 147: | ||
; Software (installed in the Lab) | ; Software (installed in the Lab) | ||
* http://www.sqlmaestro.com/products/mysql/phpgenerator/ (SQL Maestro PHP Generator) | * http://www.sqlmaestro.com/products/mysql/phpgenerator/ (SQL Maestro PHP Generator) | ||
* (optional) http://www.webformgenerator.com/ (Webform generator - this program may break your navigator) | |||
* A text editor | * A text editor | ||
* (optional) http://www.irfanview.com/ (IrfanView, free image manipulation program, including screen captures) | |||
* (optional) https://addons.mozilla.org/en-US/firefox/addon/1146 (Firefox screen capture add-on, works fine enough) | |||
; Teaching materials | ; Teaching materials |
Revision as of 17:35, 2 February 2010
Week 4 - COAP 3180
Topics Covered
HTML principles recalled
- HTML Forms
- (XMLhttprequest)
Introduction to PHP
- Principles of PHP programming
- HTML forms tutorial
- Simple PHP/MySQL interaction
Working with Apache/PHP/MySQL
- Web server organization (a look at Mowes)
Using PHP/MySQL webform generators:
- http://www.webformgenerator.com/ (Webform generator)
- http://www.sqlmaestro.com/products/mysql/phpgenerator/ (SQL Maestro PHP Generator)
Classroom activities
- HTML
- Recall of HTML principles (lecture)
- PHP
- Exploration of the PHP language (lecture)
- HTML-PHP Example
File form.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Simple test with</title></head>
<body>
<h1>Simple test with PHP</h1><hr>
<form action="process-it.php" method="post">
What do you know about HTML ?
<input type="radio" name="choice" value="1" checked>little
<input type="radio" name="choice" value="2">some
<input type="radio" name="choice" value="3">everything
<br>
What is your programming experience ?
<input type="radio" name="choice2" value="1" checked>none
<input type="radio" name="choice2" value="2">some
<input type="radio" name="choice2" value="3">good
<P>
<input type="submit" value="See result!">
</form>
</body>
</html>
File process-it.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Simple test with</title></head>
<body>
<h1>Simple test with PHP</h1><hr>
<?php
// Get variables from the form
$choice = $_POST['choice'];
$choice2 = $_POST['choice2'];
// Compute the score
$score = $choice + $choice2;
// Display the score
echo "<h3>Your score is " . $score . "</h3>";
if ($score < 3) {
echo "<p>You are a beginner</p>";
} elseif ($score < 5) {
echo "<p>You have some knowledge</p>";
} else {
echo "<p>You are an expert !</p>";
}
?>
<hr>
phpinfo();
</body>
</html>
- PHP-MySQL
- PHP MySQL functions (exploration of the online PHP manual / Slides)
- Use of PhP/MySQL generators
- Term project
- Q/A
Midterm exam (Wednesday)
Main subjects will be SQL and a little bit of database design. "Minor" subject will be web application architecture (high level principles)
SQL:
- SELECT
- SELECT ... WHERE, INSERT ... ORDER
- Joins (select from two tables)
- CREATE
- Data types: Integer, Float, VarChar, text
- DEFAULT, NOT NULL, Auto increment
- Keys
- Primary keys
- INSERT (both forms(
- UPDATE / DELETE
- DROP
Database design:
- Simple 2-3 table architectures
- 1 to N and N to N relations between tables
Exam will be "open book". I will include a set of various tasks (e.g. a simple design problem, repair problems, conceptual questions)
Homework 4
Generate and configure a web application based on a SQL table definitions.
- Create between 1 and 4 SQL tables or reuse one or all tables from homework 3
- Use Maestro to create an interface
Either:
- Migrate the files to a service provider and submit the URL to the instructor together with a short list of features you implemented in the interface
- Create a short report with a short feature list plus screen captures of the most important screens a user will see and submit either the URL or an HTML to the instructure.
In other words: I need (a) a list of what you have done and (b) either a URL where I can see the application or screen captures.
Submission Dates
- This homework is due at start of wednesday week 5
- Students must provide the URL (where the instructor can see the widget) in the world classroom
- Each homework counts 10% in your global evaluation. The four best homeworks will be taken into account.
Evaluation
- See worldclasrrom
Tips for the homework
Software, teaching materials and links
- Software (installed in the Lab)
- http://www.sqlmaestro.com/products/mysql/phpgenerator/ (SQL Maestro PHP Generator)
- (optional) http://www.webformgenerator.com/ (Webform generator - this program may break your navigator)
- A text editor
- (optional) http://www.irfanview.com/ (IrfanView, free image manipulation program, including screen captures)
- (optional) https://addons.mozilla.org/en-US/firefox/addon/1146 (Firefox screen capture add-on, works fine enough)
- Teaching materials
- HTML forms tutorial (HTML reminder about forms)
- http://tecfa.unige.ch/guides/te/files/php-mysql.pdf (slides)
- PHP with MySQL tutorials
Reading these is optional, since PHP coding will not be tested in an exam or in the term project. Below are a few PHP and PHP/MySQL tutorials that can be found on the net. There exist many others.
- Weiss, Aaron (2000) Welcome to PHP, somewhat outdated ...
- PHP Tutorial (W3C Schools, includes a section about PHP/MySQL).
- Gilfillan, Ian (2002). Using a MySQL database with PHP, Database Journal. (shorter 3-page tutorial)
- Yank, Kevin (2002) wrote a five part series in the Database Journal (Ok, but too much advertisement).
- Build Your Own Database Driven Website Using PHP & MySQL: Pt. 1 (Overview)
- Build Your Own Database Driven Website Using PHP & MySQL: Pt. 2 (yet another MySQL tutorial) ** Build Your Own Database Driven Website Using PHP & MySQL: Pt. 3 (PHP Introduction)
- Build Your Own Database Driven Website Using PHP & MySQL: Pt. 4. (Displaying information on a web page)
- MySQL PHP Web Database Tutorial (1999). Simple table, by web.blazonry
- Williams, Hugh, E. (2002). Tips for Building Web Database Applications with PHP and MySQL, onLamp article (O'Reilly Databases). HTML
- Sample chapter of Web Database Applications with PHP and MySQL website.