So we have substr and strlen PHP functions covered now – however there is alot more PHP can do out-the-box with strings. Let’s say we are storing the users full name within our database in a single column in the following format firstName-lastName. However on our frontend we want to be able to echo out the […]
Category Archives: Tutorials
String Manipulation – Using SUBSTR & STRLEN PHP Functions
Now that we’ve covered the basics of what functions are within PHP – PHP has a wide array of functions already available for you to use to work with various strings. So let’s say that we have a variable holding a user’s telephone number and we’re asking our user to input the last 4 digits of […]
The PHP Switch Conditional Statement
The switch statement allows you to simplify our previously written if…elseif…else statement by not constantly writing out the condition to check for. So, let’s take our code: And rewrite it in the form of a switch statement. This is how it works: First we have a single expression n (a variable in our case called […]
Understanding IF / ELSE / ELSEIF Statements
The majority of the time your PHP application or script will vary depending on different conditions. These conditions can be set via the script itself, or from user interaction – regardless your PHP script needs a way to handle these different situations. This is where conditional statements in PHP are introduced. PHP has several different […]
Variables – Understanding Global, Local, & Static Variable Scope
While we have covered the basics in how to use variables within PHP there’s still a whole other side to variables we haven’t discussed yet. This includes understanding variable scope …
Issuing SQL Statements Using PHP Data Objects
This tutorial expands upon our previous PHP Data Objects tutorial, which discusses how to connect to a MySQL database, and showcases how to communicate with that MySQL database once you are connected. Depending on the type of query you want to run you’ll be issuing statements in two different ways: For example let’s say you need to […]
Connecting To A Database Using PHP Data Objects
With the release of PHP 5.5.0 the mysql_* functions have become deprecated and as such connecting to a MySQL database with PHP 5.5 and up will require the use of either PHP Data Objects (PDO) or an individual MySQL driver (MySQLi). Throughout this tutorial we will focus on utilizing PDO to connect, access, and disconnect from […]
Including Another File Within Your Script
Almost all online scripts and applications will feature a core library of variables and functions that get utilized throughout the script. For example, let’s say you’re writing a database intensive application. You could declare your MySQL details within each page of your script – however if you ever changed your password that would mean that […]
Making Life Easier with PHP While Loops
The WHILE loop is one of the most useful commands in PHP. It is also quite easy to set up and use – granted it might look a bit complicated. First off however let’s figure out just what the hell a WHILE loop is – and what we need it for. A WHILE loop will, […]
Sending Mail with PHP
Mail is extremely easy to send from PHP, unlike using scripting languages which require special setup (like CGI). There is actually just one command, mail() for sending mail. In this tutorial we will discuss how to use PHP’s mail() function. It is used as follows: mail($to,$subject,$body,$headers); In this example I have used variables as they have […]
PHP Tutorials
Looking to dive into the wonderful world of PHP & MySQL? The following tutorials should help you get started. [divider3 text=”The Basics”] Echo(); Chances are you’re familiar with the Hello World exercise by now. It’s the starting point for learning almost any programming language. PHP is no different. So let’s dive right into it. How […]
Linux Server Tutorials
As a webmaster chances are you will wind up managing a Linux box or two in your time – and when you do you’ll be happy you learned these tricks. [divider3 text=”The Bash Shell”] How To Copy, Move, and Delete Files on Linux Servers A straightforward tutorial that should get you through most of the […]
HTML / CSS / JAVASCRIPT Tutorials
Getting Started with HTML HTML is the basic language used to create web pages. In fact the majority of what you see right now, on your screen, was created through the use of HTML. The tutorials listed within this section will help you get a grasp on some of the key basics of HTML programming; […]
PHP/MySQL File Upload – Error Checking
A while back I had written a PHP/MySQL tutorial discussing how to upload an image to your server, and store the information about that uploaded image into your MySQL database. That tutorial covered really only the basics, and I knew that eventually someone would post a comment asking about some more advanced features – such as […]
Creating a Dot Matrix World Map
I’m sure you have seen those dotted world maps that are utilized across dozens of business based websites these days. This Photoshop tutorial will show you how to quickly and easily create the same effect for yourself.
Performing A Make-Over Via Photoshop’s Soft Light Blend Mode
I have previously briefly touched upon working with colors inside a photo in order to change a persons hair color or eye color. This tutorial expands a little bit upon the previous one
A Simple Night Sky
Throughout this Adobe Photoshop tutorial we will go over how to create a very simple starscape look. Start off by creating a blank canvas at any size you wish to use. For the purposes of this Photoshop tutorial I went ahead and created one that is 800×800 pixels. Next fill the background with black, so […]
Basic PHP Template System
PHP has many different template solutions, and the beauty of them all is how simple it makes maintaining and changing your website. Back in the day when everything was handled with static HTML files – if you needed to add a new link to your main menu – you found yourself editing dozens if not […]
How PHP Functions Work
A PHP function is merely a block of code that can be defined once and then reused throughout various other parts of your script/program. Typically, a function takes an argument, or a series of arguments, and performs a predefined set of operations on them – returning a value as a result. With PHP functions, code […]
The PHP Ternary Operator
PHP has plenty of different operators, the majority of them being either unary or binary operators. A unary operator, such as !, performs its operations on just one single value. A binary operator, such as =, is used to perform an operation on two operads. So following the naming logic you’ve probably already figured out […]