Below are links to all the source code in this course. You can download project source code for each lecture in the course individually.

3. Variables

Source code - Variables - Write Your First PHP Code: Display a Message in Your Web Browser

Source code - Variables - Variables in PHP: What They are, How to Create Them, and How to Name Them

Source code - Variables - Basic Variable Types: Strings and Numbers

Source code - Variables - Basic Variable Types: Boolean and Null

Source code - Variables - Perform Operations on Variables: Operators

Source code - Variables - Strings: Using Single or Double Quotes and Variable Interpolation

4. Arrays

Source code - Arrays - Introduction to Arrays: Create an Array and Access its Elements

Source code - Arrays - Assign Manual Array Indexes and Create Associative Arrays

Source code - Arrays - Create and Access Multidimensional Arrays

Source code - Arrays - Process Each Element of an Array: foreach Loops

Source code - Arrays - Process the value and index of each array element using a foreach loop

5. Control structures

Source code - Control structures - Run Code Conditionally: the if Construct

Source code - Control structures - Compare One Value to another: Comparison Operators

Source code - Control structures - Run Code Multiple Times Based on a Condition: While Loops

Source code - Control structures - Run Code a Specific Number Of Times: For Loops

Source code - Control structures - Add More Conditions to an If Statement Using Elseif

Source code - Control structures - Perform Different Actions Based on Different Conditions: The Switch Statement

6. An Introduction to HTML

Source code - An Introduction to HTML - The Language of Web Pages: an Introduction To Html

Source code - An Introduction to HTML - Use Head and Body Elements to Structure An Html Document

Source code - An Introduction to HTML - Structure the Content of your Page Using Heading and Paragraph Elements

Source code - An Introduction to HTML - Give Text Emphasis or Importance Using the em and Strong Elements

Source code - An Introduction to HTML - Display Ordered and Unordered Lists of Items

Source code - An Introduction to HTML - Insert Images Into an Html Document

Source code - An Introduction to HTML - Add a Link from One Page to Another Using a Hyperlink

Source code - An Introduction to HTML - Add Semantic Structure to The Body of an Html Document

7. Mixing PHP and HTML

Source code - Mixing PHP and HTML - Create Dynamic Content: Mixing HTML and PHP

Source code - Mixing PHP and HTML - Use PHP Control Structures Mixed with HTML

Source code - Mixing PHP and HTML - Make HTML More Readable: Use Whitespace and Comments

Source code - Mixing PHP and HTML - Make PHP Easier To Maintain: Use Comments and Coding Standards


8. An Introduction to Databases

Source code - An Introduction to Databases - Where to Store Data in a Dynamic Website: An Introduction to Databases

Source code - An Introduction to Databases - Connect to the Database from PHP

Source code - An Introduction to Databases - Query the Database from PHP And Get the Results

Source code - An Introduction to Databases - Combine PHP and HTML to Show a Formatted List of Articles

9. Multiple Pages in PHP

Source code - Multiple Pages in PHP - Add a New Page to Show a Single Article

Source code - Multiple Pages in PHP - Passing Data in the URL: Send the Article ID Using the Query String

Source code - Multiple Pages in PHP - Avoid SQL Injection: Validate the ID Passed in from the Query String

Source code - Multiple Pages in PHP - Don't Repeat Yourself: Extract Repeated Code to a Separate File

Source code - Multiple Pages in PHP - Organise and Secure Access to the Included Files

10. An Introduction to HTML Forms

Source code - An Introduction to HTML Forms - Getting Data From the User: An Introduction to Forms in HTML

Source code - An Introduction to HTML Forms - Change the Method the Form Uses to Send its Data: get vs post

Source code - An Introduction to HTML Forms - Get Different Types of Data from the User: Basic Input Types

Source code - An Introduction to HTML Forms - Access Data from the form on the Server

Source code - An Introduction to HTML Forms - Add a Multi-line Text Control: the textarea Element

Source code - An Introduction to HTML Forms - Present a Fixed List of Options: the Select Element

Source code - An Introduction to HTML Forms - Toggle an Option on or off: checkboxes

Source code - An Introduction to HTML Forms - Select only one Option from a List: Radio Buttons

Source code - An Introduction to HTML Forms - Add an Accessible Caption to Each Input: the Label Element

Source code - An Introduction to HTML Forms - Make the Form Easier to Use: fieldsets and placeholders

Source code - An Introduction to HTML Forms - Common form Control Attributes: readonly, disabled and autofocus

Source code - An Introduction to HTML Forms - Validate Input Using HTML5 form Validation

11. Inserting Data Into the Database from PHP

Source code - Inserting Data Into the Database from PHP - Add a Form to Insert a New Article

Source code - Inserting Data Into the Database from PHP - Insert a New Article Into the Database and Get the ID of the New Record

Source code - Inserting Data Into the Database from PHP - How SQL Injection Attacks Work

Source code - Inserting Data Into the Database from PHP - Avoid SQL Injection Attacks: Escape Input

Source code - Inserting Data Into the Database from PHP - Avoid SQL Injection Attacks: Use Prepared Statements

12. An Introduction to Functions and Validation in PHP

Source code - An Introduction to Functions and Validation in PHP - Functions: Define and Call a Function in PHP

Source code - An Introduction to Functions and Validation in PHP - Create a Function to Connect to the Database

Source code - An Introduction to Functions and Validation in PHP - Validate the Form Data and redisplay the Form with Error Messages if Invalid

Source code - An Introduction to Functions and Validation in PHP - Maintain Previously-supplied Data When redisplaying an Invalid Form

Source code - An Introduction to Functions and Validation in PHP - Avoid Cross-site Scripting (XSS) Attacks: Escape Untrusted Content

Source code - An Introduction to Functions and Validation in PHP - Insert NULL if the Publication Date is Empty

Source code - An Introduction to Functions and Validation in PHP - Validate the Publication Date is a Valid Date and Time

Source code - An Introduction to Functions and Validation in PHP - Redirect to the Article Page After Inserting a New Article

13. Editing Data in the Database from PHP

Source code - Editing Data in the Database from PHP - Editing Existing Articles: Create a Function to Get a Single Article

Source code - Editing Data in the Database from PHP - Add a Form for Editing an Existing Article

Source code - Editing Data in the Database from PHP - Add a Validation Function and Validate the Form Data

Source code - Editing Data in the Database from PHP - Update an Existing Article in the Database

Source code - Editing Data in the Database from PHP - Create a Function to Redirect to Another URL

14. Deleting Data from the Database from PHP

Source code - Deleting Data from the Database from PHP - Delete an Existing Article in the Database

Source code - Deleting Data from the Database from PHP - Use the POST Request Method to Delete the Article

Source code - Deleting Data from the Database from PHP - Get Confirmation from the User Before Deleting the Article

Source code - Deleting Data from the Database from PHP - Improve Database Performance: Only use SELECT * when Necessary

15. Using Sessions to Log in and Restrict Access

Source code - Using Sessions to Log in and Restrict Access - Make the Web Browser Remember you Between Visits: An Introduction to Sessions

Source code - Using Sessions to Log in and Restrict Access - Store Data in the Browser: Cookies in PHP

Source code - Using Sessions to Log in and Restrict Access - Store a Value in the Session to Log in and Log out a User

Source code - Using Sessions to Log in and Restrict Access - Add a Login form and Process the User's Login Credentials

Source code - Using Sessions to Log in and Restrict Access - Completely Destroy the Session on Logout and Redirect ack to the Index Page

Source code - Using Sessions to Log in and Restrict Access - Increase Security: Prevent Session Fixation Attacks

Source code - Using Sessions to Log in and Restrict Access - Restrict Access to a Page to a Logged-in User Only

16. An Introduction to Object-Oriented PHP

Source code - An Introduction to Object-Oriented PHP - Classes and Objects: An Introduction to Object-Oriented PHP

Source code - An Introduction to Object-Oriented PHP - Object Attributes: Adding Properties to a Class

Source code - An Introduction to Object-Oriented PHP - Object Functions: Adding Methods to a Class

Source code - An Introduction to Object-Oriented PHP - Object Initialisation: the Constructor Method

Source code - An Introduction to Object-Oriented PHP - Control Access: Public and Private visibility of Properties and Methods

Source code - An Introduction to Object-Oriented PHP - Public Properties vs Getter and Setter Methods

Source code - An Introduction to Object-Oriented PHP - Static Properties and Methods

Source code - An Introduction to Object-Oriented PHP - Constants: Using Define and const to Create Constant Values

Source code - An Introduction to Object-Oriented PHP - Inheritance: Using the Extends Keyword to reuse Code and reduce Repetition

Source code - An Introduction to Object-Oriented PHP - Overriding Methods and Using the Parent Keyword to Call the Parent Class Code

Source code - An Introduction to Object-Oriented PHP - Control Access: Protected Visibility of Properties and Methods

17. PDO: PHP Data Objects

Source code - PDO: PHP Data Objects - Add a Database Class and Connect to the Database Using PHP Data Objects (PDO)

Source code - PDO: PHP Data Objects - Queries in PDO: Change the Index Page to Use the New Database Class

Source code - PDO: PHP Data Objects - Catch Database Errors Using Exceptions and try ... catch Blocks

Source code - PDO: PHP Data Objects - Prepared Statements with Named Parameters in PDO: view an Individual Article

Source code - PDO: PHP Data Objects - Create an Article Class and Use it on the Index and Article Pages

Source code - PDO: PHP Data Objects - Fetch the Database Record as an Object Instead of an Array

Source code - PDO: PHP Data Objects - Update the Article Record Using PDO

Source code - PDO: PHP Data Objects - Move the Validation Function to the Article Class

Source code - PDO: PHP Data Objects - Delete the Article Record Using PDO

Source code - PDO: PHP Data Objects - Insert a new Article Record Using PDO and get the ID of the New Record

18. Authentication Using the Database

Source code - Authentication Using the Database - Create a User Class and a Method to Authenticate a User

Source code - Authentication Using the Database - Create a Table to Store User Data in the Database

Source code - Authentication Using the Database - Authenticate the User with Data from the Database

Source code - Authentication Using the Database - Store Passwords Securely: PHP Password Hashing Functions

Source code - Authentication Using the Database - Store the Password as a Hash in the Database and Verify it on Login

19. Class Autoloading

Source code - Class Autoloading - Convert the auth Include into a Class

Source code - Class Autoloading - Convert the url Include into a Class

Source code - Class Autoloading - Autoloading Classes: Require Class Files Automatically

Source code - Class Autoloading - Add an Initialisation Script Including an Autoloader

Source code - Class Autoloading - Returning a Value Using Require: Add a Script to get the Database Connection

20. Site Administration

Source code - Site Administration - Move all Authentication-related Code to the Auth Class

Source code - Site Administration - Create an Admin Index and Load Classes Relative to the site root Directory

Source code - Site Administration - Displaying Tabular Data in HTML: Tables

Source code - Site Administration - Display the Admin List of Articles in a Table and Restrict Access to the Page

Source code - Site Administration - Add Sitewide Navigation Links

Source code - Site Administration - Move the Edit and Delete Article Scripts to the admin Area

Source code - Site Administration - Move the New Article Script to the admin Area

21. Pagination

Source code - Pagination - Add a Method to the Article Class to get a Single Page of Article Records

Source code - Pagination - Add a Paginator Class and Calculate the offset and Limit from the Page Number

Source code - Pagination - Get the Page Number from the Query String

Source code - Pagination - Validate the Page Number using the filter_var Function

Source code - Pagination - Add Previous and Next Pagination Links

Source code - Pagination - Calculate the Total Number of Records and Pages

Source code - Pagination - Add Pagination to the admin Index and Create Shared Pagination Links

22. Uploading Files

Source code - Uploading Files - Uploading Files: Add a Form to Upload an Article Image

Source code - Uploading Files - Handle the Upload Error Code

Source code - Uploading Files - Restrict the Size of all Uploaded Files using PHP Configuration Settings

Source code - Uploading Files - Restrict the Size of an Uploaded File in an Individual Form

Source code - Uploading Files - Restrict the Type of an Uploaded File

Source code - Uploading Files - Create a Folder for Uploads and Move the Uploaded File into it

Source code - Uploading Files - Sanitise the Uploaded Filename as a Security Precaution

Source code - Uploading Files - Don't Overwrite Existing Files in the Uploads Folder

Source code - Uploading Files - Save the Filename to the Article Record in the Database

Source code - Uploading Files - Display the Uploaded Image if an Article has one

Source code - Uploading Files - Delete the Previous image File when an Article Image is Updated

Source code - Uploading Files - Add an Option to Delete an Article's Image file

24. Using Relationships: Article Categories

Source code - Using Relationships: Article Categories - Show an Article's Categories on the Individual Article Page

Source code - Using Relationships: Article Categories - Get an Article's Categories in an Object Method

Source code - Using Relationships: Article Categories - Add a Category Class and form Inputs to edit an Article's Categories

Source code - Using Relationships: Article Categories - Insert Article Categories while Avoiding Duplicate Records in the Join Table

Source code - Using Relationships: Article Categories - Insert Article Categories more Efficiently using a Single Query

Source code - Using Relationships: Article Categories - Delete Article Category Records if Unchecked in the Form

Source code - Using Relationships: Article Categories - Add Categories When Inserting a new Article Record

Source code - Using Relationships: Article Categories - Pagination and Joins Show Categories in the Index Page

25. JavaScript and PHP

Source code - JavaScript and PHP - Execute Code in the Browser: An Introduction to JavaScript

Source code - JavaScript and PHP - Using the jQuery Library

Source code - JavaScript and PHP - Add jQuery and a Custom Script file to the CMS

Source code - JavaScript and PHP - Add Delete Confirmation Using JavaScript and POST

Source code - JavaScript and PHP - Client-side form Validation Using the jQuery Validation Plugin

Source code - JavaScript and PHP - An Introduction to Ajax with PHP

Source code - JavaScript and PHP - Use JSON to Safely Encode Structured Data in an Ajax Request

26. Dates and Times

Source code - Dates and Times - Only Show an Individual Article if it's been Published

Source code - Dates and Times - Only Show Published Articles on the Index Page

Source code - Dates and Times - Use the DateTime Class and the Time Element to Show the Published Date and Time

Source code - Dates and Times - Show the Published Date and Time of Articles in the admin Area

Source code - Dates and Times - Publish Unpublished Articles Using an Ajax Request

27. An Introduction to CSS

Source code - An Introduction to CSS - Add Styling and Formatting to HTML: an Introduction to CSS

Source code - An Introduction to CSS - Using CSS Frameworks: Bootstrap et al

Source code - An Introduction to CSS - Add a General Layout and Style the Navigation Links

Source code - An Introduction to CSS - Add Styling and Layout to Forms and Tables

Source code - An Introduction to CSS - Add a Custom Stylesheet and Style the List of Articles

Source code - An Introduction to CSS - Add a Date and Time Picker Plugin to make Selecting Dates and Times Easier

28. Sending Emails from PHP

Source code - Sending Emails from PHP - Add a Contact Page for Sending an Email

Source code - Sending Emails from PHP - Validate the Submitted Contact Form

Source code - Sending Emails from PHP - How to Send Email from PHP: the Mail Function and PHPMailer

Source code - Sending Emails from PHP - Send Email from the Contact Page Using PHPMailer

29. Configuration and Error Handling

Source code - Configuration and Error Handling - Extract Environment-dependent Settings out into a Single Configuration File

Source code - Configuration and Error Handling - Deny Direct Access to the config file from a Browser

Source code - Configuration and Error Handling - Handing Errors and Exceptions: user-defined Handling Functions

Source code - Configuration and Error Handling - Display Error and Exception Details Depending on the Environment

Source code - Configuration and Error Handling - HTTP Status Codes and Handling Ajax Errors

30. Conclusion

Source code - Conclusion - Deployment: Publish your Code on a Live Server