Introduction
A PHP course designed to enable web developers and others with limited programming experience to build dynamic database driven e-commerce web sites using the PHP programming language. Since PHP is such a rich and task-specific language, the course covers the most important range of functions in depth, and equips delegates to understand the remaining less essential aspects. The contents of this PHP course are identical to our three day in-house "PHP for Programmers" course, but the pacing is adjusted to suit the needs of public delegates and non-programmers.
PHP is Open Source and Cross Platform, running on Unix, Linux, MS Windows, Apple Mac, AS/400 and more, and is often used with an OS-CP database and web server such as MySql and Apache. Thus PHP will work on the operating system and hardware that currently suits your applications and organisation. PHP is a ''P'' in the LAMP stack.
PHP 5 is the current version of PHP and is what the course teaches. Differences with PHP 4 are explained for those who need to maintain legacy code. There is also a look forwards to the features expected in PHP 6. MySQL 5 is the primary database that is used, the course also covers Oracle and MS-SQL. Delegates should have few problems transferring their learned skills to interacting to other databases with PHP.
The last day of the course is taken producing a complete database driven application. An application skeleton is provided (and can be taken away) which makes for a quick start. There are short reviews including: Apache configuration, SQL (SELECT, JOIN & WHERE). Delegates are shown how to: manage test and production sites (configuration, copying, avoiding confusion as to which is which). A complete sample solution is given to the delegates.
Suitable For
Web developers and web designers with a modest amount of programming experience. Students will typically have used another simple or domain-specific language such as VBscript or Javascript.
If you are new to programming or web development and are contemplating the use of PHP we suggest that you read our notes on introductory courses first.
Prerequisites
A basic working knowledge of HTML is presumed.
Some conceptual knowledge of how web servers and web browsers (clients) interact using HTTP
A working knowledge of at least one scripting/programming language or evidence of strong capabilities in relevant areas of mathematical/logical reasoning
Contents
Introduction to PHP
Taking user input (HTML forms)
PHP Operators
Conditional Tests and Events in PHP
PHP Functions
Storing Data in Arrays using PHP
Handling Databases with PHP
Sessions and Cookies in PHP
Create &edit data
A PHP course designed to enable web developers and others with limited programming experience to build dynamic database driven e-commerce web sites using the PHP programming language. Since PHP is such a rich and task-specific language, the course covers the most important range of functions in depth, and equips delegates to understand the remaining less essential aspects. The contents of this PHP course are identical to our three day in-house "PHP for Programmers" course, but the pacing is adjusted to suit the needs of public delegates and non-programmers.
PHP is Open Source and Cross Platform, running on Unix, Linux, MS Windows, Apple Mac, AS/400 and more, and is often used with an OS-CP database and web server such as MySql and Apache. Thus PHP will work on the operating system and hardware that currently suits your applications and organisation. PHP is a ''P'' in the LAMP stack.
PHP 5 is the current version of PHP and is what the course teaches. Differences with PHP 4 are explained for those who need to maintain legacy code. There is also a look forwards to the features expected in PHP 6. MySQL 5 is the primary database that is used, the course also covers Oracle and MS-SQL. Delegates should have few problems transferring their learned skills to interacting to other databases with PHP.
The last day of the course is taken producing a complete database driven application. An application skeleton is provided (and can be taken away) which makes for a quick start. There are short reviews including: Apache configuration, SQL (SELECT, JOIN & WHERE). Delegates are shown how to: manage test and production sites (configuration, copying, avoiding confusion as to which is which). A complete sample solution is given to the delegates.
Suitable For
Web developers and web designers with a modest amount of programming experience. Students will typically have used another simple or domain-specific language such as VBscript or Javascript.
If you are new to programming or web development and are contemplating the use of PHP we suggest that you read our notes on introductory courses first.
Prerequisites
A basic working knowledge of HTML is presumed.
Some conceptual knowledge of how web servers and web browsers (clients) interact using HTTP
A working knowledge of at least one scripting/programming language or evidence of strong capabilities in relevant areas of mathematical/logical reasoning
Contents
Introduction to PHP
- History of PHP
- PHP tools and set up (web browser/server, editor, libraries, etc)
- Create a basic PHP Script
- Opening and Closing tags
Taking user input (HTML forms)
- Use PHP to generate HTTP headers
- Generating HTTP redirects
- Pass PHP variables via the URL
- Debugging Tips
- Where to find PHP documentation
- Taking User Input from Forms via PHP
- Creating forms with PHP
- Security Protection from Cross Site Scripting
- Using the form GET method
- Using the form POST method
- Obtaining data from forms through variables
- $_REQUEST, $_POSTor $_GET?
- Magic Constants
- GLOBALSarray
- Variable References
PHP Operators
- Arithmetic Operators
- Logical Operators
- Relational (Comparison) Operators
- The Assignment Operators
- Increment &Decrement Operators
Conditional Tests and Events in PHP
- True and False
- if
- Comparing Strings and Numbers
- elseand elseif
- Hierarchical conditions (nested ifstatements)
- The ? :Operator
- Comparing for equality or identity
- The switch/ casestatement
- Alternative Syntax for Control Structures
PHP Functions
- Purpose of functions
- Built-in functions
- Declaring functions
- Functions Arguments
- Default Arguments
- Arguments - Call by Reference
- Return
- Returning References
- Static variables
- Recursion
- includeand require
- Variable function calls
Storing Data in Arrays using PHP
- What are arrays?
- How and when to use arrays
- Indexing arrays, numeric and hashes
- Initialising arrays
- Using foreach
- Add/remove elements from arrays
- One-dimensional arrays
- Multi-dimensional arrays
- References to array elements
- Arrays in forms
- Array operators
- Array related functions
Handling Databases with PHP
- PHP's database APIs
- Error-handling strategies
- Connection/disconnection to the database, log in/log out
- Escaping strings in SQL statements
- Including common access functions
- Doing simple SQL queries via PHP
- Building HTML tables using SQL Queries
- Access to: MySql, MySqli, Oracle &MS-SQL
Sessions and Cookies in PHP
- Putting it all together — displaying data
Create &edit data
- Creating &editing data
- Creating &editing are much the same
- Use the same names everywhere
- outline use of a HTML_QuickForm2form
- Adding fields to the form
- Field validation
- Validation types
- Smarty Template with HTML_QuickForm2
- Form validation and processing
- Display of validation errors
- Conclusion
- References to interesting PHP resources on the web