facebook google plus twitter

Webucator's Free PHP Tutorial

Welcome to our free PHP tutorial. This tutorial is based on Webucator's Introduction to PHP Training course.
Start Tutorial or choose from a lesson below
In this lesson, you will get a thorough introduction to how PHP works and you will write your first PHP scripts. We will also introduce you to the website you will be building throughout this course.
Conditional processing allows programmers to execute different code based on specific conditions. There are two conditional structures in PHP - if - elseif - else and switch / case. There is also a special operator called the ternary operator for short conditional expressions.
Arithmetic Operators are used to perform math operations in PHP. Loops are used to run the same code a number of times until some condition is met.
Up to this point, we have dealt only with variables that store single values, called scalar variables. In this lesson, we will be covering arrays. Arrays are variables that store sets of values.
There are a few different ways of working with databases in PHP, but the most common two are through extensions that ship as part of PHP: the MySQL Improved (mysqli) extension and the PHP Data Objects (PDO) extension. They work in much the same way. In this course, we will teach the PDO extension as it can be used with any database; whereas mysqli just works with MySQL. We will start the lesson with an overview of objects and classes as it's important to understand a bit about object-oriented programming to work with PDO.
Like most programming languages, PHP throws exceptions (i.e., reports an error with detailed information) when something goes wrong. The programmer can anticipate, catch, and handle those exceptions in the code.
A common way to pass data from one page to another is through HTML forms. There are two methods of submitting data through a form: the get method and the post method. In this lesson, you will learn to use both.
In this lesson, we show you how to use PHP's built-in mail() function, and then show you how to use PHPMailer, an excellent email extension, which provides more features than the built-in mail() function.
In this lesson, you will learn how to create a secure and user-friendly registration and authentication process.
This lesson consists of four exercises: Creating a page to submit a new poem. Modifying the poems page so that it shows all the current user's poems, even those not yet approved. Creating a page to edit an existing poem. Creating a page to delete a poem. This lesson has no final quiz.
In some cases, you may need to collect files from website users. You can do this using the file input type. But you'll want to be careful not to just allow any type or any size file to be uploaded.