
Master intermediate PHP concepts by exploring object oriented programming, secure coding, PDO database interaction, and an introduction to Laravel, while building and consuming rest apis for real-world projects.
Learn to navigate this PHP for Beginners course by choosing the full curriculum or micro courses, with section introductions and topics like PDO and secure programming.
Skip the next two videos and start the course right away if you have already downloaded VS Code and exam.
Install XAMPP to run a local Apache server with MySQL, PHP, and phpMyAdmin for back-end development. Start the control panel and access localhost to verify the stack.
Install Visual Studio Code on Windows to set up the primary text editor for coding, download and install, and create a desktop icon while noting alternatives like PhpStorm and Notepad++.
Master the fundamentals of PHP and object-oriented programming, including classes, objects, properties, methods, and visibility, and encapsulation, inheritance, polymorphism, abstractions, interfaces, and namespaces for scalable code.
Learn PHP OOP fundamentals, including classes, objects, properties, and methods, and the four pillars—encapsulation, abstraction, inheritance, polymorphism—to build scalable, reusable code with MVC and the dry principle.
Explore how classes serve as blueprints in PHP and how objects are instantiated with the new keyword. Follow naming conventions, like upper camel case, and keep one class per file.
Explore PHP properties and methods, learning how to define public data holders, access them via an object, and implement simple public functions to manipulate and return values.
Leverage the dollar sign this keyword to reference the current object and access properties and methods within a class, demonstrated with name and password via the object operator.
Learn how the private keyword restricts property access to within the class, why that security matters, and how getter and setter methods expose and validate the data.
Explore PHP magic methods, focusing on constructors and destructors, which initialize objects and clean up resources; constructors can take parameters, destructors cannot.
Learn encapsulation in PHP by bundling data and methods into a class, restricting direct access, and exposing data with getter and setter methods to protect internal state.
Explore how PHP inheritance lets a child class extend a parent class to reuse methods and properties, with overriding support, promoting reusability, extensibility, and the DRY principle.
Learn how inheritance handles constructors in PHP, including automatic parent constructor calls, overriding child constructors, and invoking parent constructors with parent::__construct(), illustrated by animal and dog examples.
Override parent class methods in PHP by redefining functions in the child class and optionally extending behavior with the parent call. Use the final keyword to prevent overrides.
In this PHP inheritance lesson, study the protected keyword for properties and methods, and see how protected members are accessible inside the class and its children but not from outside.
Explore polymorphism through abstract classes, contracts and abstract methods, showing how subclasses like dog and cat override behavior while sharing a common parent.
Explore polymorphism in PHP by implementing interfaces as contracts with public methods, contrasting them with abstract classes, and see how a class can implement multiple interfaces to promote flexibility.
Explore polymorphism with multiple interfaces by having classes implement several interfaces, then use type hinting to inject interface objects and trigger shared methods like running and make sound.
Explore static properties and methods, which belong to the class rather than instances, accessible without creating an object; use self for class references and static for shared state.
Define class constants with the const keyword, accessed via the class name, inherently static, keep values fixed, and rely on inheritance or overriding in child classes.
Explore PHP abstraction by using abstract classes and methods to define a non-instantiated base contract, hide implementations, and let multiple classes share a structure with different behavior.
Explore traits as a PHP code reuse mechanism in single inheritance, enabling sharing of methods and properties across classes; a trait is not a class and cannot be instantiated.
Discover PHP file handling basics, from simple file functions to advanced streams, and master relative and absolute paths for reading, writing, and managing logs, configurations, csv/json data, and uploads.
Explore reading files in PHP using if open, f.read, gets, and file get contents, and compare whole-file reads with line-by-line reads for large files and memory considerations.
Learn to write to files in PHP using file_put_contents and fopen modes, including w to overwrite, e to append, and x to create new files.
Explore PHP streams and file pointers for precise file reading and navigation. Use ftell to locate the current position, fseek to jump, and fgets to read lines.
Explore how PHP manages server files by deleting, renaming, and copying them with built-in functions. Use unlink, rename, and copy with file exists function checks for safe operations.
Learn to upload files in PHP by using the $_FILES global, validating errors, size, and type, and securely moving uploads to a uniquely named destination folder.
Learn to work with directories in PHP by listing files with opendir, readdir, and closedir, and using the scan function to read a directory, plus mkdir, rmdir, and unlink.
Explore how to check file and directory information in PHP by using built-in functions to verify file exists, get file size, last modified time, and read or write permissions.
Learn how to use the chmod change mode function to set read, write, and execute permissions for owner, group, and others on Linux, with Windows limitations and octal representations.
Explore continuing PHP learning resources, including the PHP manual's file system section, Tutorial Points file handling, download file, header functions, and W3Schools, to deepen your understanding.
Explore the PHP data objects (PDO) data abstraction layer that unifies database connections across databases, using PDO, PDOStatement, and PDOException, with prepared statements for security and reusable code.
Install and set up the Sublime Text editor by downloading it from the official site and completing the Windows installation. Enable the left sidebar to access open files during coding.
Connect to a database using PDO in PHP by configuring host, dbname, user, and password with the MySQL driver, and test the connection to verify it works.
Master PHP error handling with try-catch, set attributes, and custom video exceptions to produce friendly database error messages and gracefully terminate the script.
Use the query method to fetch titles from the posts table with a while loop and fetch, echoing each title; switch to body to retrieve post bodies.
Explore retrieving data with query and foreach in PHP, comparing fetch versus foreach for multiple rows, using while loops, and applying aliases to print results.
Learn how to fetch database results in PHP using fetch modes—associative array, indexed array, and object—and when to use each, with practical examples for echoing body data.
Learn how fetch column returns a single result in PHP, using a default first-row index, and see how it differs from fetch all as introduced for the next lecture.
Master fetching all data with fetchAll in PHP, choosing associative arrays, index arrays, or objects to access post titles and bodies from the statement results.
Explore prepared statements as data handlers that sanitize user input before database insertion to prevent SQL injections, and learn to bind values with execute and placeholders, including the positional operator.
Learn how to use prepared statements to update and delete records in a PHP database, including binding parameters, updating post titles, and deleting by ID.
Learn how to use row count to detect the number of results from a SQL query, print the count, loop through records, and handle no results gracefully.
Learn how to retrieve the last inserted ID after a database insert using prepared statements in PHP.
Master how transactions protect multi-step database operations by wrapping queries in a begin transaction block, committing on success and rolling back on error via try catch and exception handling.
Learn how to close a database connection in php by setting the connection variable to null, terminate the script, and understand the resulting fatal error when querying after closure.
Set up a PHP database connection by defining host, database name, user, and password; enable PDO exceptions and create a tasks table with a default current timestamp.
Create a PHP form that posts data to the server, then use a prepared statement to insert the input into the database table after validation.
Master inserting data with prepared statements, fix submit button handling, redirect to index after insert, then fetch and loop through records to display them in a table.
Learn to delete data in PHP by preparing and executing a delete query on the posts table after validating the target id, then verify removal on the index page.
Update the data using a PHP update query by fetching the target record, showing it in a form, and applying changes to the tasks table by id.
Learn to defend PHP apps by mitigating SQL injection, cross-site request forgery, and file upload attacks, while applying input validation, password hashing, session security, and production-ready configurations.
Learn general PHP security tips, including validating and sanitizing all user input and enforcing https everywhere. Practice ongoing security through updates, frameworks, and monitoring for exploits.
Discover how cross-site scripting enables attackers to inject javascript via user inputs, and learn to prevent it by escaping input with htmlspecialchars and utf-8 encoding in PHP.
Explore remote file inclusion risks in PHP, showing how unsanitized user input can include and execute remote files, and implement safeguards like whitelists or disabling allow_url_include.
Hash passwords to protect user data in PHP by converting them to hashes and using password_hash and password_verify for secure login.
Disable PHP error messages in production while logging errors for later debugging, using ini_set to hide display_errors and display_startup_errors and to configure error_log to a log file.
Protect directory listings in your PHP projects by adding an .htaccess with options -Indexes to Apache, preventing access to uploads and config files and returning a 403 forbidden message.
Master safe PHP redirects by using the header function with exit immediately after to prevent code from running post-redirect, avoiding data leaks and security risks.
Understand why https is essential for web apps by comparing http and https, and learn how ssl/tls encryption protects data, credentials, cookies, and sessions from eavesdropping.
Apply a cPanel directory firewall to restrict direct access to sensitive PHP folders like config, vendor, and includes, and manage access with login credentials.
Learn to protect directories with htaccess by restricting access to specific IP addresses on Apache, using allow from, deny from, and understanding 403 forbidden responses.
This video shows how to block execution of specific file extensions, like PHP, in upload directories using an htaccess file, returning 403 forbidden.
Secure file uploads by restricting allowed file types and validating mime types to prevent malicious scripts and denial of service, with PHP examples for handling uploads and testing forms.
Learn to secure file uploads by enforcing a two‑megabyte size limit and renaming uploaded files to unique names, preventing overwrites and enhancing upload security.
Fix log errors to turn scattered logs into a clean, actionable record that prevents security vulnerabilities and data leaks. Keep logs clean to spot new issues quickly and improve performance.
Learn why back end validation matters for security and data integrity, and how server-side PHP validation prevents front end bypasses, ensuring consistent defense in depth across apps.
Learn how session fixation works and how to prevent it in PHP by regenerating the session ID after login and enforcing HTTPS.
Explore SQL injection vulnerabilities in PHP login forms and demonstrate preventing them with PDO prepared statements and bound parameters.
Explore cross-site request forgery (CSRF) attacks and learn to prevent them in PHP by using a session-based CSRF token embedded in forms and validated on submission.
Learn to build modern PHP APIs from scratch, including rest concepts, CRUD operations, JSON handling, and testing with Postman to create scalable back-end services for front-end applications.
Explain what an api is as a communication interface, outline rest api principles like statelessness and resource-based urls, and name http methods such as get, post, put, and delete, json.
Install and explore Postman to test APIs, send get, post, put, patch, and delete requests, view responses in JSON, XML, or HTML, and save requests into collections for reuse.
Set up the PHP API project in htdocs, create API and source folders with controllers, models, core, and an autoloader, then test endpoints with Postman.
Develop a PHP autoloader using SPL autoload register, map AB-prefixed namespaces to directories, convert namespace to file paths, and auto-require the database class for testing.
Learn to connect to a database in PHP using PDO, implementing a private static connection and a static connect method. Use try/catch with PDOException for friendly error messages; namespace autoloading.
Create a post model for a php crud app, implementing get all posts, get single post by id, and create post using prepared statements with a pdo database connection.
Complete the post model by implementing update and delete methods, using placeholders and execute with id, title, body, and author to securely modify or remove posts, preparing for controllers.
Create and manage posts by implementing a posts controller with store and update methods, sanitizing inputs with trim and html special chars, and delegating to the post model.
Read all posts from posts table via the post model's getAllPosts, returning a json data array of posts (id, title, body, author, createdat). Test with php built-in server and postman.
Fetch a single post by id via a get request, validate the id as an integer, and return a JSON response with status and post data or an error message.
Create a new post through a PHP API endpoint, handle post requests with CORS and JSON input, decode data, insert via the post controller, and return a JSON success response.
Implement a PHP update endpoint for posts using put, validate the post id, decode JSON body, set title, body, and author, perform the update, and return a JSON status.
Implement post deletion in a PHP API by validating the post ID, invoking the post model's delete function, and returning a JSON status with HTTP 200.
Validate http response codes for individual and all post endpoints, returning 400 for bad requests, 200 for success, and 404 when posts or ids are missing, with json-encoded data.
Add http response codes to create, update, and delete endpoints, validate inputs and errors with 400, 404, 500, and 200 responses, and test typical delete scenarios.
Validate input across endpoints by checking required fields and empty values, returning friendly json messages. Enforce http methods for create, update, and delete, and test with postman using post requests.
Are you ready to take your PHP skills to the next level and start building professional, scalable web applications?
Welcome to the Intermediate PHP Course — a hands-on, project-based journey designed to bridge the gap between beginner and advanced PHP development.
In this course, you’ll move beyond the basics of syntax and simple scripts to learn how to structure, secure, and scale your PHP applications using modern techniques and best practices. You’ll gain the confidence and clarity needed to write production-ready code and understand how real-world PHP projects are built.
We’ll begin with a quick setup and introduction to ensure your environment is ready (PHP, MySQL, and VS Code). Then we’ll dive deep into Object-Oriented Programming (OOP) — the foundation of modern PHP. You’ll learn about classes, inheritance, interfaces, traits, and magic methods, and how to use namespaces to organize your code efficiently.
Next, you’ll master working with files and directories, including file uploads, permissions, and security best practices. From there, we’ll explore how to work with databases using PDO, including prepared statements, transactions, and error handling. You’ll solidify these skills through a mini-project — building a task manager or notes app with full CRUD functionality.
Security is a core focus of this course. You’ll learn to protect your applications against common attacks like XSS, CSRF, and SQL Injection, while also understanding proper password hashing, session handling, and secure cookies.
Then, you’ll move on to building and consuming APIs, learning the fundamentals of RESTful design, request routing, responses, HTTP methods, response codes, and JSON data formats. Then you’ll move step-by-step through building a fully functional REST API using pure PHP — with clean code organization, routing, error handling, and security best practices. You’ll learn how to connect your API to a MySQL database using PDO, work with CRUD operations, and return structured JSON responses.
Finally, we’ll wrap up with an introduction to frameworks, where you’ll learn how frameworks like Laravel implement MVC, routing, controllers, and views. You’ll even learn how to migrate a raw PHP app into Laravel to see the difference in structure and workflow.
By the end of this course, you’ll have the skills, mindset, and portfolio projects needed to confidently move into modern PHP development — whether your goal is to freelance, get hired, or start building your own SaaS apps.