PHP for Beginners

Build a Content Management System from Scratch with PHP and MySQL
PHP for Beginners
File Size :
5.67 GB
Total length :
14h 12m



Tim Buchalka's Learn Programming Academy


Last update

Last updated 9/2022



PHP for Beginners

What you’ll learn

Learn how to create a dynamic website using the most popular website programming language
Build a working CMS in PHP and MySQL from scratch
Learn how to secure your code
Learn how to write reusable, more maintainable code using programming standards
Learn how to structure your code using object-oriented programming techniques
Learn the theory but then put it into practice in a CMS project
Style your site using Bootstrap
How to integrate third-party code into your site
How to store data in a relational database and use this from PHP code
Learn all aspects of a basic web application in PHP: login, CRUD operations, sending emails, uploading files, Ajax

PHP for Beginners


Access to a computer running Windows, Mac OS X or Linux.


Are you wanting to get into Web development, but are not sure where to start? So maybe you tried out some PHP and MySQL tutorials on Youtube, but found them too hard or outdated, and feel that you need a more comprehensive introduction.
Maybe you want to learn how to write PHP the right way.  Secure code, OOP ready, and maximising re-usability as well as finding out about PHP programming standards to adopt and adhere too?Perhaps your boss or client threw you in the deep end with a PHP and MySQL project, and you need to get up to speed with PHP, fast.Whatever the reason, this course is for you.This course is going to teach you how to create web applications using PHP and MySQL.  Specifically, you will learn PHP and then create you own content management system (CMS) from scratch.
Why PHP?
PHP is the most popular website programming language in the world.  The combination of PHP and MySQL is used extensively to create web applications, and developers with these key skills are in high demand.  This course is going to teach you how to create web applications in PHP using the MySQL database.What will you learn in this course?You will learn  how to create a dynamic website using the most popular website programming language in the world, PHP.Dave Hollingworth, your instructor will teach you the PHP programming language, and take you through the steps to build a working CMS in PHP and MySQL from scratch.Along the way, you will learn how to secure your code, how to write reusable, more maintainable code using programming standards, and how to structure your code using object-oriented programming techniques.Dave will teach you the theory and then put the theory into practice when building the CMS.You will also learn how to style your site using Bootstrap, how to integrate third-party code into your site, how to store data in a relational database and use this from PHP code, and more.The course is very thorough, and goes through everything from installing a web server on your own computer, and editor to writing the code to create your web app.  Towards the end of the course you will even learn how to upload the code and make your code live on the internet (very useful if you already have your own Hosting account).  This is not necessary to complete the course though.In summary, the course will teach you the core skills you need to know to become a productive PHP programmer.Why this course?Firstly, Dave has been creating web applications since 1999, when he created his first web application for a major insurance company.  In addition he has been teaching IT for many years.As a result, you will be learning the best practices from an experienced developer.Dave will teach you the theory but then show how to put those techniques into practice.  You will start building a CMS application from early on in the course and new techniques and theory are introduced as and when they’re needed to build the next part of the CMS.New code is introduced one word or one line at a time, so you will never get bogged down or overwhelmed.You will also learn real-world developer skills such as referring to and getting the most out of the documentation. This is an essential skill for developers to learn.After completing this course, you will have the necessary skills to be able to create your own web applications with PHP and MySQL.
The sooner you sign up for this course, the sooner you will have the skills and knowledge you need to increase your job or consulting opportunities.    PHP developers are in high demand!
Your new job or consulting opportunity awaits!
Why not get started today?
Click the Signup button to sign up for the course!


Section 1: Introduction

Lecture 1 Introduction: How to Get the Most Out of the Course

Section 2: Software Installation and Setup

Lecture 2 Recommended Software Overview

Lecture 3 Install XAMPP on Windows

Lecture 4 Install XAMPP on MAC OS X

Lecture 5 Install XAMPP on Ubuntu Linux

Lecture 6 Install Atom on Windows

Lecture 7 Install Atom on MAC OS X

Lecture 8 Install Atom on Ubuntu Linux

Section 3: Variables

Lecture 9 Write Your First PHP Code: Display a Message in Your Web Browser

Lecture 10 Variables in PHP: What They are, How to Create Them, and How to Name Them

Lecture 11 Basic Variable Types: Strings and Numbers

Lecture 12 Basic Variable Types: Boolean and Null

Lecture 13 Perform Operations on Variables: Operators

Lecture 14 Strings: Using Single or Double Quotes and Variable Interpolation

Section 4: Arrays

Lecture 15 Introduction to Arrays: Create an Array and Access its Elements

Lecture 16 Assign Manual Array Indexes and Create Associative Arrays

Lecture 17 Create and Access Multidimensional Arrays

Lecture 18 Process Each Element of an Array: foreach Loops

Lecture 19 Process the value and index of each array element using a foreach loop

Section 5: Control structures

Lecture 20 Run Code Conditionally: the if Construct

Lecture 21 Compare One Value to another: Comparison Operators

Lecture 22 Run Code Multiple Times Based on a Condition: While Loops

Lecture 23 Run Code a Specific Number Of Times: For Loops

Lecture 24 Add More Conditions to an If Statement Using Elseif

Lecture 25 Perform Different Actions Based on Different Conditions: The Switch Statement

Section 6: An Introduction to HTML

Lecture 26 The Language of Web Pages: an Introduction To Html

Lecture 27 Use Head and Body Elements to Structure An Html Document

Lecture 28 Structure the Content of your Page Using Heading and Paragraph Elements

Lecture 29 Give Text Emphasis or Importance Using the em and Strong Elements

Lecture 30 Display Ordered and Unordered Lists of Items

Lecture 31 Insert Images Into an Html Document

Lecture 32 Add a Link from One Page to Another Using a Hyperlink

Lecture 33 Add Semantic Structure to The Body of an Html Document

Section 7: Mixing PHP and HTML

Lecture 34 Create Dynamic Content: Mixing HTML and PHP

Lecture 35 Use PHP Control Structures Mixed with HTML

Lecture 36 Make HTML More Readable: Use Whitespace and Comments

Lecture 37 Addendum: changes to the available resources in the following video

Lecture 38 Make PHP Easier To Maintain: Use Comments and Coding Standards

Section 8: An Introduction to Databases

Lecture 39 Where to Store Data in a Dynamic Website: An Introduction to Databases

Lecture 40 Access the Database Server Using phpMyAdmin And Create a Database

Lecture 41 Use Tables to Store Structured Data in a Database

Lecture 42 Select Some Data from The Database: An Introduction to Sql

Lecture 43 Using Indexes: Make Queries Faster and Order the Result Set

Lecture 44 Connect to the Database from PHP

Lecture 45 Query the Database from PHP And Get the Results

Lecture 46 Combine PHP and HTML to Show a Formatted List of Articles

Section 9: Multiple Pages in PHP

Lecture 47 Add a New Page to Show a Single Article

Lecture 48 Passing Data in the URL: Send the Article ID Using the Query String

Lecture 49 Avoid SQL Injection: Validate the ID Passed in from the Query String

Lecture 50 Don’t Repeat Yourself: Extract Repeated Code to a Separate File

Lecture 51 Addendum: changes to the code in the following video

Lecture 52 Organise and Secure Access to the Included Files

Section 10: An Introduction to HTML Forms

Lecture 53 Getting Data From the User: An Introduction to Forms in HTML

Lecture 54 Change the Method the Form Uses to Send its Data: get vs post

Lecture 55 Addendum: datetime and datetime-local input types

Lecture 56 Get Different Types of Data from the User: Basic Input Types

Lecture 57 Access Data from the form on the Server

Lecture 58 Add a Multi-line Text Control: the textarea Element

Lecture 59 Present a Fixed List of Options: the Select Element

Lecture 60 Toggle an Option on or off: checkboxes

Lecture 61 Select only one Option from a List: Radio Buttons

Lecture 62 Add an Accessible Caption to Each Input: the Label Element

Lecture 63 Make the Form Easier to Use: fieldsets and placeholders

Lecture 64 Common form Control Attributes: readonly, disabled and autofocus

Lecture 65 Validate Input Using HTML5 form Validation

Section 11: Inserting Data Into the Database from PHP

Lecture 66 Addendum: the datetime-local input type

Lecture 67 Add a Form to Insert a New Article

Lecture 68 Insert Data Into the Database: The SQL INSERT INTO Statement

Lecture 69 Insert a New Article Into the Database and Get the ID of the New Record

Lecture 70 How SQL Injection Attacks Work

Lecture 71 Avoid SQL Injection Attacks: Escape Input

Lecture 72 Avoid SQL Injection Attacks: Use Prepared Statements

Section 12: An Introduction to Functions and Validation in PHP

Lecture 73 Functions: Define and Call a Function in PHP

Lecture 74 Create a Function to Connect to the Database

Lecture 75 Validate the Form Data and redisplay the Form with Error Messages if Invalid

Lecture 76 Maintain Previously-supplied Data When redisplaying an Invalid Form

Lecture 77 Avoid Cross-site Scripting (XSS) Attacks: Escape Untrusted Content

Lecture 78 Insert NULL if the Publication Date is Empty

Lecture 79 Validate the Publication Date is a Valid Date and Time

Lecture 80 Redirect to the Article Page After Inserting a New Article

Section 13: Editing Data in the Database from PHP

Lecture 81 Editing Existing Articles: Create a Function to Get a Single Article

Lecture 82 Add a Form for Editing an Existing Article

Lecture 83 Add a Validation Function and Validate the Form Data

Lecture 84 Change Existing Data in the Database: The SQL UPDATE Statement

Lecture 85 Update an Existing Article in the Database

Lecture 86 Create a Function to Redirect to Another URL

Section 14: Deleting Data from the Database from PHP

Lecture 87 Delete Existing Data in the Database: The SQL DELETE Statement

Lecture 88 Delete an Existing Article in the Database

Lecture 89 Use the POST Request Method to Delete the Article

Lecture 90 Get Confirmation from the User Before Deleting the Article

Lecture 91 Improve Database Performance: Only use SELECT * when Necessary

Section 15: Using Sessions to Log in and Restrict Access

Lecture 92 Make the Web Browser Remember you Between Visits: An Introduction to Sessions

Lecture 93 Store Data in the Browser: Cookies in PHP

Lecture 94 Store a Value in the Session to Log in and Log out a User

Lecture 95 Add a Login form and Process the User’s Login Credentials

Lecture 96 Completely Destroy the Session on Logout and Redirect Back to the Index Page

Lecture 97 Increase Security: Prevent Session Fixation Attacks

Lecture 98 Restrict Access to a Page to a Logged-in User Only

Section 16: An Introduction to Object-Oriented PHP

Lecture 99 Classes and Objects: An Introduction to Object-Oriented PHP

Lecture 100 Object Attributes: Adding Properties to a Class

Lecture 101 Object Functions: Adding Methods to a Class

Lecture 102 Object Initialisation: the Constructor Method

Lecture 103 Control Access: Public and Private visibility of Properties and Methods

Lecture 104 Public Properties vs Getter and Setter Methods

Lecture 105 Static Properties and Methods

Lecture 106 Constants: Using Define and const to Create Constant Values

Lecture 107 Inheritance: Using the Extends Keyword to reuse Code and reduce Repetition

Lecture 108 Overriding Methods and Using the Parent Keyword to Call the Parent Class Code

Lecture 109 Control Access: Protected Visibility of Properties and Methods

Section 17: PDO: PHP Data Objects

Lecture 110 Add a Database Class and Connect to the Database Using PHP Data Objects (PDO)

Lecture 111 Queries in PDO: Change the Index Page to Use the New Database Class

Lecture 112 Catch Database Errors Using Exceptions and try … catch Blocks

Lecture 113 Prepared Statements with Named Parameters in PDO: view an Individual Article

Lecture 114 Create an Article Class and Use it on the Index and Article Pages

Lecture 115 Fetch the Database Record as an Object Instead of an Array

Lecture 116 Update the Article Record Using PDO

Lecture 117 Move the Validation Function to the Article Class

Lecture 118 Delete the Article Record Using PDO

Lecture 119 Insert a new Article Record Using PDO and get the ID of the New Record

Section 18: Authentication Using the Database

Lecture 120 Create a User Class and a Method to Authenticate a User

Lecture 121 Create a Table to Store User Data in the Database

Lecture 122 Authenticate the User with Data from the Database

Lecture 123 Store Passwords Securely: PHP Password Hashing Functions

Lecture 124 Store the Password as a Hash in the Database and Verify it on Login

Section 19: Class Autoloading

Lecture 125 Convert the auth Include into a Class

Lecture 126 Convert the url Include into a Class

Lecture 127 Autoloading Classes: Require Class Files Automatically

Lecture 128 Add an Initialisation Script Including an Autoloader

Lecture 129 Returning a Value Using Require: Add a Script to get the Database Connection

Section 20: Site Administration

Lecture 130 Move all Authentication-related Code to the Auth Class

Lecture 131 Create an Admin Index and Load Classes Relative to the site root Directory

Lecture 132 Displaying Tabular Data in HTML: Tables

Lecture 133 Display the Admin List of Articles in a Table and Restrict Access to the Page

Lecture 134 Add Sitewide Navigation Links

Lecture 135 Move the Edit and Delete Article Scripts to the admin Area

Lecture 136 Move the New Article Script to the admin Area

Section 21: Pagination

Lecture 137 Pagination: Split Database Results up Into Pages

Lecture 138 Add a Method to the Article Class to get a Single Page of Article Records

Lecture 139 Add a Paginator Class and Calculate the offset and Limit from the Page Number

Lecture 140 Get the Page Number from the Query String

Lecture 141 Validate the Page Number using the filter_var Function

Lecture 142 Add Previous and Next Pagination Links

Lecture 143 Calculate the Total Number of Records and Pages

Lecture 144 Add Pagination to the admin Index and Create Shared Pagination Links

Section 22: Uploading Files

Lecture 145 Uploading Files: Add a Form to Upload an Article Image

Lecture 146 Handle the Upload Error Code

Lecture 147 Restrict the Size of all Uploaded Files using PHP Configuration Settings

Lecture 148 Restrict the Size of an Uploaded File in an Individual Form

Lecture 149 Restrict the Type of an Uploaded File

Lecture 150 Create a Folder for Uploads and Move the Uploaded File into it

Lecture 151 Sanitise the Uploaded Filename as a Security Precaution

Lecture 152 Don’t Overwrite Existing Files in the Uploads Folder

Lecture 153 Save the Filename to the Article Record in the Database

Lecture 154 Display the Uploaded Image if an Article has one

Lecture 155 Delete the Previous image File when an Article Image is Updated

Lecture 156 Add an Option to Delete an Article’s Image file

Section 23: Database Relationships

Lecture 157 Database Relationships: Create a Table and Data for Categories

Lecture 158 One-to-one Relationships Between Tables

Lecture 159 One-to-many Relationships Between Tables

Lecture 160 Joins: Selecting Data from Multiple, Related Tables at Once

Lecture 161 Relationship Constraints

Lecture 162 Many-to-many Relationships Between Tables

Section 24: Using Relationships: Article Categories

Lecture 163 Show an Article’s Categories on the Individual Article Page

Lecture 164 Get an Article’s Categories in an Object Method

Lecture 165 Add a Category Class and form Inputs to edit an Article’s Categories

Lecture 166 Insert Article Categories while Avoiding Duplicate Records in the Join Table

Lecture 167 Insert Article Categories more Efficiently using a Single Query

Lecture 168 Delete Article Category Records if Unchecked in the Form

Lecture 169 Add Categories When Inserting a new Article Record

Lecture 170 Pagination and Joins: Show Categories in the Index Page

Section 25: JavaScript and PHP

Lecture 171 Execute Code in the Browser: An Introduction to JavaScript

Lecture 172 Using the jQuery Library

Lecture 173 Add jQuery and a Custom Script file to the CMS

Lecture 174 Add Delete Confirmation Using JavaScript and POST

Lecture 175 Client-side form Validation Using the jQuery Validation Plugin

Lecture 176 An Introduction to Ajax with PHP

Lecture 177 Use JSON to Safely Encode Structured Data in an Ajax Request

Section 26: Dates and Times

Lecture 178 Only Show an Individual Article if it’s been Published

Lecture 179 Only Show Published Articles on the Index Page

Lecture 180 Use the DateTime Class and the Time Element to Show the Published Date and Time

Lecture 181 Show the Published Date and Time of Articles in the admin Area

Lecture 182 Publish Unpublished Articles Using an Ajax Request

Section 27: An Introduction to CSS

Lecture 183 Add Styling and Formatting to HTML: an Introduction to CSS

Lecture 184 Using CSS Frameworks: Bootstrap et al

Lecture 185 Add a General Layout and Style the Navigation Links

Lecture 186 Add Styling and Layout to Forms and Tables

Lecture 187 Add a Custom Stylesheet and Style the List of Articles

Lecture 188 Add a Date and Time Picker Plugin to make Selecting Dates and Times Easier

Section 28: Sending Emails from PHP

Lecture 189 Add a Contact Page for Sending an Email

Lecture 190 Validate the Submitted Contact Form

Lecture 191 Get Access to a Mail Server

Lecture 192 How to Send Email from PHP: the Mail Function and PHPMailer

Lecture 193 Send Email from the Contact Page Using PHPMailer

Section 29: Configuration and Error Handling

Lecture 194 Extract Environment-dependent Settings out into a Single Configuration File

Lecture 195 Deny Direct Access to the config file from a Browser

Lecture 196 Handing Errors and Exceptions: user-defined Handling Functions

Lecture 197 Display Error and Exception Details Depending on the Environment

Lecture 198 HTTP Status Codes and Handling Ajax Errors

Section 30: Conclusion

Lecture 199 Deployment: Publish your Code on a Live Server

Lecture 200 Conclusion: Where to go from Here

Section 31: Extra Information – Source code, and other stuff

Lecture 201 Source Code for all Lectures

Lecture 202 Bonus Lecture and Information

Anyone wanting to learn both the PHP language and how to create web applications

Course Information:

Udemy | English | 14h 12m | 5.67 GB
Created by: Tim Buchalka’s Learn Programming Academy

You Can See More Courses in the Developer >> Greetings from

New Courses

Scroll to Top