In this post, we’ll learn how to implement reCAPTCHA on a website. Recaptcha is used to confirm that the user interaction on your site was made by a human and not by some script. For example, if you have a contact form on your website you would want to implement some human verification to prevent getting spammed by bots.
In this code snippet, we’ll learn how to perform string sanitization in PHP. An attacker might try to inject some malicious code into your backend. As a developer, you can prevent that by filtering/sanitizing and validating your data before working with it.
In this code snippet, we’ll learn how to read and write files with PHP. Let’s see the example below.
In this code snippet, we’ll learn how to send emails with PHPMailer in PHP. First, we’ll need to install the PHPMailer package. We’ll do that using a dependency manager for PHP called Composer. (See this tutorial if you want to know how to install Composer in the first place.)
In this tutorial, we’ll learn how to install and use Composer. Composer is a PHP dependency manager that simplifies adding and managing libraries in your PHP projects.
In this code snippet, we’ll learn how to zip files in PHP.
This post contains a list PHP code snippets. In the code snippets, you can find PHP related topics with a quick explanation and a code example. I made this collection of code snippets so that if I ever forget something I can just come here to refresh my memory. Hopefully, you’ll find it useful too.
Some time ago I had to make a WordPress plugin as part of my job. Here I will document what I have learned in the process. Hopefully, this can also be useful to anyone who wants to make their own plugin or do any other WordPress development. In this post, we will make a plugin while at the same time learning how to use some of the WordPress APIs.