Transcript Document

Dynamic Server Pages
Copyright © 2002 ProsoftTraining. All rights reserved.
Lesson 1:
Introduction
to PHP
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Define PHP
• Identify platforms and Web servers that
support PHP
• Describe the installation and configuration of
PHP
• Discuss add-on modules used with PHP
• Create a Web publishing directory
What Is PHP?
• Server-side scripting language
• Embedded in HTML documents
• Known as PHP Hypertext Preprocessor
Supported Platforms
and Web Servers
• PHP modules
• CGI interpreter or Apache module?
Installation
and Configuration
• Installing MySQL
• Installing PHP
Summary
 Define PHP
 Identify platforms and Web servers that
support PHP
 Describe the installation and configuration of
PHP
 Discuss add-on modules used with PHP
 Create a Web publishing directory
Lesson 2:
PHP Fundamentals
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
Describe the structure of PHP pages
Define variables and data types
Discuss and use constants
Discuss variable functions
Define and use operators
PHP Mechanics
•
•
•
•
Script delimiters
Page structure
Containers
Comments
PHP Variables
• Data types
– Integer
– Double
– String
• Constants
• Type casting
• Variables and form data
PHP Operators
• Operator precedence
Summary





Describe the structure of PHP pages
Define variables and data types
Discuss and use constants
Discuss variable functions
Define and use operators
Lesson 3:
PHP Statements
and Flow Control
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
Describe and use conditional statements
Define and use switch statements
Define and use for loops
Define and use while loops
Conditional
Statements
• if statements
• switch statements
Loops
• for loops
• while loops
Summary




Describe and use conditional statements
Define and use switch statements
Define and use for loops
Define and use while loops
Lesson 4:
PHP Arrays
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
Describe and use PHP arrays
Discuss associative arrays
Discuss multidimensional arrays
Sort PHP arrays
PHP
Arrays
• Associative arrays
• Multidimensional arrays
• Sorting arrays
– The sort ( ) and assort ( ) functions
– The array_multisort ( ) function
Summary




Describe and use PHP arrays
Discuss associative arrays
Discuss multidimensional arrays
Sort PHP arrays
Lesson 5:
PHP Functions
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
•
Define and use functions
Explain and use the function statement
Pass arguments to PHP functions
Return values from PHP functions
Explain variable scope in PHP
Assign a function to a variable
PHP
Functions
•
•
•
•
The function statement
Passing arguments
Variable scope
Assigning a function to a variable
Summary






Define and use functions
Explain and use the function statement
Pass arguments to PHP functions
Return values from PHP functions
Explain variable scope in PHP
Assign a function to a variable
Lesson 6:
String Manipulation
and File Input/Output
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
•
Discuss PHP string functions
Describe and use regular expressions
Define and use pattern matching
Open and close files on the server
Write to and read from files on the server
Create and use flat database files
String Functions
•
•
•
•
•
•
•
strlen() function
substr() function
strpos() function
trim() function
strtolower() and strtoupper() functions
ucfirst() and ucwords() functions
printf() and sprintf() functions
Regular Expressions
and Pattern Matching
• Common escape sequences
• Built-in character classes
Regular
Expression Functions
• ereg() and eregi() functions
• ereg_replace() and eregi_replace()
functions
File Input
and Output
•
•
•
•
•
Opening files
File mode specifiers
Reading files
Writing to files
Moving within files
Summary






Discuss PHP string functions
Describe and use regular expressions
Define and use pattern matching
Open and close files on the server
Write to and read from files on the server
Create and use flat database files
Lesson 7:
PHP and
Databases
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
•
•
Explain the basics of databases
Explain database structure and schemas
Define and use SQL
Discuss cursors and result sets
Define stored procedures
Add records to and search a database
Update and delete records from an ODBCcompliant database
Relational
Databases
• Tuples
• Attributes
• Objects
Primary Keys
and Foreign Keys
BankAccount Table
Customer Table
Integer ID
Integer ID
Double Balance
String FName
Boolean Checking
String LName
Date StartDate
String Address
Integer Customer
Structured
Query Language (SQL)
• Data Definition Language (DDL)
• Data Query Language (DQL)
• Data Manipulation Language (DML)
Cursors
and Result Sets
• ResultSet = RecordSet
• Loop construct
• The next() method
ODBC
• ODBC and PHP
• ODBC functions
• The PHP application
Summary







Explain the basics of databases
Explain database structure and schemas
Define and use SQL
Discuss cursors and result sets
Define stored procedures
Add records to and search a database
Update and delete records from an ODBCcompliant database
Lesson 8:
Debugging PHP
and PHP Security
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
Explain debugging PHP applications
Describe errors and error handling
Describe PHP security issues
Explain safe mode
Debugging
PHP Applications
•
•
•
•
Syntax errors
Runtime errors
Logical errors
Error messages in PHP
– Parse errors
– Fatal errors
– Warnings
– Notices
• Error handling
Preventing Errors
•
•
•
•
Script by design
Keep the script simple
Adhere to strict naming conventions
Use a modular approach
PHP
Security Issues
•
•
•
•
•
Securing the server
Settings
Configuration options
Safe mode
Writing secure PHP applications
Summary




Explain debugging PHP applications
Describe errors and error handling
Describe PHP security issues
Explain safe mode
Lesson 9:
Active
Server Pages (ASP)
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Define an ASP file and ASP-based applications
• Describe ISAPI programs
• Discuss the Web servers that support ASP
applications
• Describe the structure of ASP technology
• Define and create virtual directories
• Define and use server-side include files
• Create and use a global.asa file
Introduction
• Microsoft Internet Information Server
• Internet Server Application Programming
Interface
ASP
Mechanics
•
•
•
•
•
Dynamic link library
Comparing ASP and other technologies
ODBC
Out-of-process
In-process
Virtual Directories
and ASP Applications
• Virtual directories are mappings between a
name and an actual path to a real directory
• Virtual directories contain:
– global.asa file
– default.htm or default.asp
ASP
Delimiters
• Server-side includes
• ASP support for scripting languages
Global.asa—Starting a
Web Application
• Global.asa defines the properties of a Web
application
Summary
 Define an ASP file and ASP-based applications
 Describe ISAPI programs
 Discuss the Web servers that support ASP
applications
 Describe the structure of ASP technology
 Define and create virtual directories
 Define and use server-side include files
 Create and use a global.asa file
Lesson 10:
Using VBScript
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Identify and use VBScript operators and
expressions
• Define and use VBScript variables and data
types
• Declare VBScript arrays
• Define and use conditional statements and
looping constructs
• Create subroutines and functions
VBScript
• Scripting languages
• Scripting engines
Differences Between
VBScript and JavaScript
• Calling functions and subroutines
• Function calls and implementation in
JavaScript and VBScript
• Event-driven programming
Declaring
Variables with VBScript
• Declaring variables
– Dim keyword
– Public keyword
– Private keyword
• Naming variables
• Arrays, ReDim, and Preserve
• Collections
• Option Explicit
• Data subtypes and conversion functions
Program Flow
•
•
•
•
•
•
If statements
Select Case statements
Looping constructs
For…Next statements
Do… loops
While…Wend statements
Summary
 Identify and use VBScript operators and
expressions
 Define and use VBScript variables and data
types
 Declare VBScript arrays
 Define and use conditional statements and
looping constructs
 Create subroutines and functions
Lesson 11:
ASP
Intrinsic Objects
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Identify and use ASP intrinsic objects
• Define and use properties and methods of ASP
objects
• Use the Request and Response objects
• Identify Server object properties
• Identify the ObjectContext object
• Discuss object scope
ASP
Objects
• ScriptingContext
• Server
• Application
• Session
• Request
• Response
Summary
 Identify and use ASP intrinsic objects
 Define and use properties and methods of ASP
objects
 Use the Request and Response objects
 Identify Server object properties
 Identify the ObjectContext object
 Discuss object scope
Lesson 12:
ASP Default
Components
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Identify and use ASP default components
• Define and use properties and methods of ASP
components
• Create and write to a flat database file
Global
Objects
•
•
•
•
<OBJECT> tag
ID parameter
ProgID parameter
ClassID parameter
ASP Default
Components
• Ad Rotator
• Browser
Capabilities
• Content Linking
• Content Rotator
• Counters
• Page Counter
• Permission
Checker
• FileSystemObject
• ActiveX Data
Objects
Summary
 Identify and use ASP default components
 Define and use properties and methods of ASP
components
 Create and write to a flat database file
Lesson 13:
ActiveX
Data Objects
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
Define ODBC and OLE DB
Define and use ADO
Define and create DSNs
Insert records into a database using ASP and
ADO
• Update and delete records in a database using
ASP and ADO
Open Database
Connectivity and OLE DB
ActiveX
Data Objects
Registering
Data Source Names
• User DSNs
• System DSNs
• File DSNs
Summary




Define ODBC and OLE DB
Define and use ADO
Define and create DSNs
Insert records into a database using ASP and
ADO
 Update and delete records in a database using
ASP and ADO
Lesson 11:
Error Handling and Debugging
for ASP Applications
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
•
Discuss debugging ASP applications
Discuss errors and error handling
Define the VBScript Err object
Describe and create custom error numbers
Discuss error logging
Discuss the Microsoft Script Debugger
Debugging
ASP Applications
•
•
•
•
Handling errors
The Err object
Logging errors
Microsoft Script Debugger
Summary






Discuss debugging ASP applications
Discuss errors and error handling
Define the VBScript Err object
Describe and create custom error numbers
Discuss error logging
Discuss the Microsoft Script Debugger
Lesson 15:
Project Management
in Application Development
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
•
•
•
•
•
•
Discuss project management fundamentals
Define source and revision control
Discuss coding standards
Define code optimization
Define and use a test assessment plan
Discuss application testing both before and
after deployment
Project Management
Fundamentals
• What is project management?
– Business process/functionality design
– Technology/architecture design
– Implementation/development
– Pilot/parallel
– Cutover/live
• Further study
– PMI
– ISO 9000 series
Source and
Revision Control
•
•
•
•
•
Program code control
Version-control software
Revision Control System (UNIX)
Source Code Control System (UNIX)
Visual SourceSafe (Microsoft)
Coding
Standards
•
•
•
•
•
•
•
•
Indentation and margins
Matching brackets
Parentheses
Reserved words and keywords
Naming conventions
Language constructs
Comments
Error handling
Code
Optimization
• Loops
• General optimization tips
– Variables
– Arrays
• ASP optimization
Test
Assessment Plans
•
•
•
•
Creating a test plan
Glass-box testing
Black-box testing
Post-live testing
Summary






Discuss project management fundamentals
Define source and revision control
Discuss coding standards
Define code optimization
Define and use a test assessment plan
Discuss application testing both before and
after deployment
Lesson 16:
Data Integrity
and Security Issues
Copyright © 2002 ProsoftTraining. All rights reserved.
Objectives
• Discuss basic database construction issues
• Explain data integrity
• Define various mechanisms for insuring data
integrity
• Discuss the different goals of security
• Explain the basis of encryption
• Examine the different protocols used as
encryption is applied to various situations
Database
Design Fundamentals
• Designing the database
• Data integrity
• Data input anomalies
Database
Security Issues
• Data Control Language
• Other security-related issues
– Hardware volatility and failure
– Concurrent access
• User authorization
• General security information
Security Goals
• Transmission integrity
• Authentication
• Secrecy
Encryption
• Algorithm
• Key
– Key length
– Key space
Symmetric, Asymmetric,
and One-Way Algorithms
• Symmetric encryption example
– Rot-13
• One-way encryption
• Public-key encryption
• Private-key encryption
Protocols
• Authentication and digital signatures
• Diffie-Hellman key exchange and certificate
authorities
• X.509 format
Summary
 Discuss basic database construction issues
 Explain data integrity
 Define various mechanisms for insuring data
integrity
 Discuss the different goals of security
 Explain the basis of encryption
 Examine the different protocols used as
encryption is applied to various situations
Dynamic Server Pages







Introduction to PHP
PHP Fundamentals
PHP Statements and Flow Control
PHP Arrays
PHP Functions
String Manipulation and File Input/Output
PHP and Databases
Dynamic Server Pages





Debugging PHP and PHP Security
Active Server Pages (ASP)
Using VBScript
ASP Intrinsic Objects
ASP Default Components
Dynamic Server Pages
 ActiveX Data Objects
 Error Handling and Debugging for ASP
Applications
 Project Management in Application
Development
 Data Integrity and Security Issues