PHP Programming
THIS IS A DRAFT
This text may not be complete.
PHP Programming Training Materials
IMPORTANT NOTE for trainers only: Please DO NOT change these materials, especially the EXERCISES, without direct permission from: LUKASZ SOKOLOWSKI.
Copyright Notice
Copyright © 2004-2025 by NobleProg Limited All rights reserved.
This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.
Intro
- general-purpose scripting language
- especially suited to web development
- fast, flexible and pragmatic
- powers everything from simple blog to the corporate organisations
Intro con't
PHP - recursive acronym for PHP: Hypertext Preprocessor
- widely-used open source language
- can be embedded into HTML
- code is executed on the server, generating HTML which is then sent to the client
- extremely simple, yet offers many advanced features
Data Structures (refresher only)
- Associative arrays
- Session variables, global variables, cookies
- Date
- File and File Upload
- Cookies and Sessions
- Error Handling
- Exceptions Handling
- PHP Filter
Security
- authorization and authentication
- using cookies and sessions
Dealing with Images
GD Library and alternatives
PHP XML
- SimpleXML
- Expat Parser
- XML DOM
Object-Oriented Programming
Terminology Object Declaring classes and constructors Creating and Using Objects Properties and methods Inheritance Access modifiers Magic methods Declaring and using interfaces exception Handling
Using Databases
Methods of data storing data PDO extension Connecting to a database using PDO Operations on data Error Handling PDO Transactions Primary keys Joins Aggregate functions and grouping connect to the database storing passwords executing queries processing data modifying and removing data binding form to records in the database
Programming interfaces
Architecture services Adding to the system API The data format JSON and XML RESTful Services Designing Web Service
Design Patterns
What are design patterns Singleton Pattern Factory Pattern MVC model-view-controller
Efficiency
Research applications performance Code cache
Safety
Filtering input Session fixation Session hijacking SQL injection Storing passwords SSL