Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

PHP Lessons - Lesson 13 - OOP (Object Oriented Programming) Basics

16/04/2025, by Ivan

In previous lessons, I’ve already discussed the following PHP data types: boolean, integer, float, string, and arrays. In this lesson, I’ll introduce one more data type available in PHP — the object.
Objects are somewhat similar to arrays — they can contain various data types including numbers, text, arrays, and even other objects.

PHP Lessons - Part 2 - Forms, Files, Sessions and Security in PHP

16/04/2025, by Ivan

If you’ve read the first part of the PHP lessons, then you already know at least how to write code in PHP. In this part, we’ll dive deeper into the language and explore the following topics:

  1. Working with forms in PHP
  2. Working with files in PHP
  3. Cookies in PHP
  4. Sessions in PHP
  5. Sending emails with PHP
  6. Security in PHP

However, we won’t study these topics separately as traditional PHP tutorials often do. Instead, we’ll apply all these features in the process of creating a small website.

PHP Lessons - Lesson 1 - Working with Forms

16/04/2025, by Ivan

In everyday life, we get information from television, radio, the internet, or through live communication. Websites also receive information from users, but they do so in a special way — through forms. Forms can be compared to paper questionnaires or official application forms. Despite the limited number of form elements, forms allow websites to gather all the necessary user data.

To get the most out of this lesson, you should review basic HTML form creation tutorials.

PHP Lessons - Lesson 2 - Working with files: opening, writing, reading.

16/04/2025, by Ivan

In the previous lesson, we built the framework for our guestbook, blog, or chat application. Now it’s time to add functionality. In this lesson, we’ll save entries to files and display entries from those files.

PHP has many functions for file operations. We’ll look at a few of them. Most likely, your website will store data in a database (I’m sure of that) rather than in files. So we’ll just touch on the basics here to give you an understanding. We'll cover working with databases later.

If you don’t have the files from the last lesson, go back and download them first.

PHP Lessons - Lesson 3 - Working with MySQL DB.

16/04/2025, by Ivan

You might think it’s too early to begin the third lesson with working in MySQL. But trust me, it’s not. Learning PHP as a web programming language without learning how it interacts with databases is like having a computer without internet. Yes, you can work on such a computer, but you won’t be able to get information. So let’s grit our teeth and start writing SQL queries, even if we know nothing about the SQL language yet.

PHP Lessons - Lesson 3.2 - Working with MySQL DB. Inserting data INSERT INTO. Selecting data SELECT

16/04/2025, by Ivan

In the previous lesson, we created a table for our website. In this lesson, we will improve the table and start working with the database: adding and retrieving data from it. I don’t think anything too difficult is coming up, so let’s begin.

First, I suggest we improve our messages table. Right now it has fields for the data, but it needs an extra column for numbering records. If you look at the Drupal database, the node table has a nid field for this purpose. We’ll do something similar with our messages table.

PHP Lessons - Lesson 3.3 - Working with MySQL DB. Updating data UPDATE.

16/04/2025, by Ivan

We have already learned MySQL operators like SELECT and INSERT INTO. Now it's time to learn how to update existing data in the database using the SQL UPDATE operator. But first, let's modify our index.php file and add a new route. Find this code:

if ($_GET['admin'] == 1) { 
  print $obj->display_admin(); 
} else {
  print $obj->display_public(); 
}

And replace it with the following code:

PHP Lessons - Lesson 3.4 - Working with MySQL DB. DELETE Deletion Queries.

16/04/2025, by Ivan

In the previous lesson, we learned how to add new methods to our management class simpleCMS. Now let’s add one more method to delete a record: delete().

We’ll add the method as usual:

public function delete($mid) {
    
}

As you can see, we pass a parameter $mid – the ID of our record. If you recall the previous lesson, we used a different approach to pass the parameter via a GET request. This time we’ll try passing the parameter another way.

PHP Lessons - Lesson 3.5 - Working with MySQL DB. JOIN operator. Uploading files to the server.

16/04/2025, by Ivan

Before I started writing this lesson, I thought for a long time about the best way to present queries using the JOIN operator. The point is that the JOIN operator is used to retrieve data from multiple tables at once. And since we need another table, let's create one. I suggest creating a table for files, which we will upload through a form in this lesson. This way, the lesson will combine two directions: working with databases and working with forms.