Write laravel for a living? Maybe make sure that you don’t let your web server serve your .env files. Sample Google search: db_username filetype:envContinue reading "PSA: Make sure that your server is not serving your .env file"
Previously, we looked at how to read data from a MySQL database, using PDO. So, how do you add records and update them? Let’s start with how to add a record …Continue reading "PHP: Using PDO to insert and update data"
PHP Data Objects (PDO) is a database abstraction layer that is available in PHP 5.1 and above. Before PDO, PHP developers used extensions like MySQL and MySQLi. So, why is PDO better than MySQLi? It supports more database systems than MySQL.Continue reading "PHP: Using PDO to query a database"
Now that we have gone through variables, conditional logic, and functions, let’s look at how you take input from the user. PHP has two associative arrays for form data: ‘$_GET’ and ‘$_POST’. ‘$_GET’ shows any get data and ‘$_POST’ shows any post data.Continue reading "PHP: Taking form input and sending emails"
Now that variables, ways of comparing variables, and conditional logic, let’s step it up a little and look at looks and functions.Continue reading "PHP: Loops, functions, and server-side includes"
Arithmetic operations comparison of values are fundamental things that you need to do in any language. PHP is not any different. Let’s cover how it handles them. Let’s start with the arithmetic operators …Continue reading "PHP: Math, comparisons, and conditions"
A programmer can’t get by with simple variables alone. Sometimes you need other tools. Let’s take a look at three options that you have.Continue reading "PHP: Arrays, associative arrays, and objects"
In the previous post, we talked about creation of variables and output of their values. Let’s talk a little more about strings.Continue reading "PHP: Fun with strings"
So, you want to write some PHP? I’m going to go over some basics of PHP in the next few posts. This first post is going to cover basic variables. Step #1: You need to define set up your PHP file PHP is executed out of files that end in ‘.php’ (as you might expect). …Continue reading "PHP: Basic Variables"