Listing the Contents of a Directory With PHP

Following is a quick tutorial explaining how to list the contents of a directory with PHP. Much of this information is taken from the official PHP documentation of the opendir() function.
To begin with, you need to determine which directory you want to list. Start by storing the location of that directory in a variable. If [...]

Simple SQL Search

Introduction
Often I see many posts about how to do a simple SQL search. Well I finally caved in and decided to write a tutorial just for that. I will try and explain everything in as much detail as I can without being over wordy. This is a basic search, nothing more. If you want a [...]

Back Up A Large MySQL Database

Anyone that’s dealt with a Web application using a MySQL backend has probably dealt with incomplete backups. Those of you that use phpBB have almost certainly encountered this issue. Unfortunately, within phpBB and quite a few other PHP/MySQL-based applications, the backup scripts fail miserably with any reasonably large amount of data. Most of them fail [...]

Object-Oriented Programming - Parents and Children

This post is going to be a somewhat short abstract about the concept of parents and children in object-oriented programming (OOP). The first thing of which people new to OOP need to be aware is that parents and children are are not handled as logical parents and children, they are handled more like biological parents [...]

phpCache — speed up your website

Caching seems to be the new trend. But aside from all the marketing, it’s really a lot more than that. If you don’t have the money to buy those lovely Zend products, you might find yourself turning to the world of Open Source (again). And viola! You’ll be helped.
There are two ways to cache with [...]

Coding With CodeIgniter

I’ve been coding away at my new startup CloudContacts for a good bit now and I’ve found that using the CodeIgniter PHP framework has been great. I’ve always been able to edit PHP code pretty well but starting an application from scratch has been a struggle. I watched a few CodeIgniter videos and was off. [...]

PHP Basics for Designers

The Atlanta Web Design Group recently held a discussion about PHP basics for web designers. Here are the slides from the presentation.

View SlideShare presentation or Upload your own.

Some Handy Array Functions in PHP

This post will go over the basics of some very nice array-related functions that are built in to PHP. If you use arrays fairly often in your PHP code, you will no doubt find a use for each of these handy functions over time.
array_combine
This function takes two arrays and puts them together, though not in [...]

Using MySQL with PHP - Part 1

This is a very simple tutorial intended to explain how to connect to a MySQL database with PHP and how to retrieve and manipulate information from that database.
Prior Steps
Before you actually connect to a database, you need to have a database to which to connect. Further, you need to have a table inside of that [...]

Check Your PHP Code For Vulnerability

I’ve been meaning to review some of my older PHP code for security vulnerabilities for a while, but never really got around to it. This afternoon, I started searching for some tools I might be able to use to do that for me. I came across the Spike PHP Security Audit Tool, and was actually [...]

Eight Links - April 22

Here are today’s Eight Links — links for web developers:

JsPDF - create PDF files completely using JavaScript
The Database Rant - begins with “It’s time for SQL to die.”
iPhone app sales - a developer explains the income his app has generated and how changing pricing didn’t change sales
Why writing software is like writing
18 Seriously Helpful Cheat [...]

Running PHP Scripts with Cron

Lots of programmers like PHP for its ability to code and develop web applications fast. Code-debugging is a lot easier than with PERL or C. However, there is one thing a lot of developers are puzzled about, “How to run PHP Scripts with crontab?”
Cron is normally available on all Unix and Linux distributions; if you [...]

Avoiding SQL Injection with PHP

This is a very quick tutorial to help people avoid SQL injection with their PHP scripts. It seems all too common that people are writing PHP scripts without considering the fact that someone could easily inject some malicious SQL code that could wreak havoc on an entire Web site.
To put it very simply, for those [...]

Check Your PHP Code For Vulnerability

I’ve been meaning to review some of my older PHP code for security vulnerabilities for a while, but never really got around to it. This afternoon, I started searching for some tools I might be able to use to do that for me. I came across the Spike PHP Security Audit Tool, and was actually [...]

Using MySQL with PHP - Part 1

This is a very simple tutorial intended to explain how to connect to a MySQL database with PHP and how to retrieve and manipulate information from that database.
Prior Steps
Before you actually connect to a database, you need to have a database to which to connect. Further, you need to have a table inside of that [...]

Working with checkboxes and a database

Introduction
Over in the php help forum, the question of how to deal with checkboxes arises pretty often. Usually, people want to be able to select which rows of a database to update/delete/throw out the window.
The concept is actually pretty simple. It involves naming your checkbox as an array and the use of the IN mysql [...]

PHP Add Text To Image

Dynamic Image Generation
Long and boring back-story….

One of the standard features of a message board is allowing members to have a signature, which is appended to the bottom of each post they make. Posters can put whatever they want into the signature (within forum settings). Putting quotes in one’s signature is one of the [...]

Protecting php applications with PHPIDS

Introduction
PHPIDS (PHP-Intrusion Detection System) is a simple to use,
well structured, fast and state-of-the-art security layer
for your PHP based web application. The IDS neither strips,
sanitizes nor filters any malicious input, it simply
recognizes when an attacker tries to break your site and
reacts in exactly the way you want it to. Based on a set of
approved and heavily [...]

PHP Custom List Order

So you have some tabular data printed out in your browser. You can even change the order of the information by clicking on the column name at the top of your list. But can you make your own custom list order?
Or maybe you’re deciding to make a content management system [...]

Regular Expressions (Part1) - Basic Syntax

Table of Contents

1. Regular Expressions Basics
2. Creating Your Own Patterns
3. How Metacharacters Work
4. Quantifier Greediness
5. Pattern Modifiers
6. PCRE vs. POSIX
7. Putting it All Together
8. Conclusion and Future Tutorials

Regular Expressions Basics

What are Regular Expressions?
Regular expressions (which will now be referred to as "regexes") are basically pattern matching inside of text. They use special syntax and [...]

Integrating Wordpress into dynamic templates

I installed a Wordpress blog on my development server the other day and began playing with it. The first real challenge I faced was how to pull my Wordpress installation into my Web site’s template.
My issue is, I’m using a content management system (CMS) to manage the bulk of my Web site’s content. [...]

PHP Form Validation

The validation of data that has been entered in a form is necessary in most cases. Why is important? For example, what good is holding a contest or sweepstakes if you can’t notify the winner, because he or she entered an invalid telephone number or an incorrect address. What good is having a mailing list [...]

Hotlink Protection with PHP

What is Hotlinking?
Hotlinking is when another website links directly to one or more of your images or multimedia files and includes it on their web page. Not only is this theft of your intellectual property, but further more, you are paying for the bandwidth used by that site. Which can result in a problem with [...]

Avoiding SQL Injection with PHP

This is a very quick tutorial to help people avoid SQL injection with their PHP scripts. It seems all too common that people are writing PHP scripts without considering the fact that someone could easily inject some malicious SQL code that could wreak havoc on an entire Web site.
To put it very simply, for those [...]

Running PHP Scripts with Cron

Lots of programmers like PHP for its ability to code and develop web applications fast. Code-debugging is a lot easier than with PERL or C. However, there is one thing a lot of developers are puzzled about, “How to run PHP Scripts with crontab?”
Cron is normally available on all Unix and Linux distributions; if you [...]

Object-Oriented Programming - Parents and Children

This post is going to be a somewhat short abstract about the concept of parents and children in object-oriented programming (OOP). The first thing of which people new to OOP need to be aware is that parents and children are are not handled as logical parents and children, they are handled more like biological parents [...]

phpCache — speed up your website

Caching seems to be the new trend. But aside from all the marketing, it’s really a lot more than that. If you don’t have the money to buy those lovely Zend products, you might find yourself turning to the world of Open Source (again). And viola! You’ll be helped.
There are two ways to cache with [...]

Coding With CodeIgniter

I’ve been coding away at my new startup CloudContacts for a good bit now and I’ve found that using the CodeIgniter PHP framework has been great. I’ve always been able to edit PHP code pretty well but starting an application from scratch has been a struggle. I watched a few CodeIgniter videos and was off. [...]

PHP Basics for Designers

The Atlanta Web Design Group recently held a discussion about PHP basics for web designers. Here are the slides from the presentation.

View SlideShare presentation or Upload your own.

Some Handy Array Functions in PHP

This post will go over the basics of some very nice array-related functions that are built in to PHP. If you use arrays fairly often in your PHP code, you will no doubt find a use for each of these handy functions over time.
array_combine
This function takes two arrays and puts them together, though not in [...]

PHP Add Text To Image

Dynamic Image Generation
Long and boring back-story….

One of the standard features of a message board is allowing members to have a signature, which is appended to the bottom of each post they make. Posters can put whatever they want into the signature (within forum settings). Putting quotes in one’s signature is one of the [...]

The PHP Blog is launched!

What can I expect here?
Basically we’re aiming to cover all aspects of PHP coding that the common developer will run in to, we’ll also aim to teach you new techniques and styles to improve your codes efficiency, style and overall effectiveness.
Stay tuned!
With the launch of The PHP Blog we’ll aim to deliver 1-2 tutorials a [...]

The ins and outs of SQL injection

What is SQL injection?
SQL injection is an extremely overlooked problem, especially with how easy it is for Joe Bloggs and John Smith to setup their own website and do with it what they wish. SQL injection is the equivalent of letting any old user manipulate your database, be it for malicious purposes or not.This dangerous [...]

Getting to Grips With Functions

An overview of functions
Using functions in your code should be 2nd nature in medium to large scale projects. In basic terms, a function is a block of code with a name, and a majority will take parameters/arguments and return a value(s). If you’ve done PHP before (if you’re reading this I’m guessing you have) you [...]

We’ve moved host, no more downtime!

Bad Timing
When you’re trying to get a site off the ground like a tutorial site and your hits are steadily increasing the worst thing that could happen is an unexpected period of downtime with no explanation, especially when that downtime is about 5 days long.
Recently we’ve experienced a lot of downtime thanks to our previous [...]

Bare Basics - Arrays

What is an array?
The concept of arrays are simple. If you create a variable to store a value, it does exactly that, stores a single value. Whether it’s an integer, string or anything in between. An array is basically a variable that can hold multiple values. Arrays have many uses, but that’s a little beyond [...]

More Advanced Arrays

Quick Recap
Ok so hopefully you read this tutorial first so that you have a basic understanding of the different types of array and what we can store in them.
Built-in Array Functions
Rather than mess around coding our own functions, which so many new developers do without even looking to see if it’s already been done, PHP [...]

We’ve got a sister!

The PHP Blog was the first of its kind from our wonderful team, but today we have an addition to the family with the launch of the iPhone SDK blog!
The iPhone SDK Blog will bring you regular tutorials on many aspects of developing applications for the iPhone, be sure to check them out and add [...]

Working with checkboxes and a database

Introduction
Over in the php help forum, the question of how to deal with checkboxes arises pretty often. Usually, people want to be able to select which rows of a database to update/delete/throw out the window.
The concept is actually pretty simple. It involves naming your checkbox as an array and the use of the IN mysql [...]

Protecting php applications with PHPIDS

Introduction
PHPIDS (PHP-Intrusion Detection System) is a simple to use,
well structured, fast and state-of-the-art security layer
for your PHP based web application. The IDS neither strips,
sanitizes nor filters any malicious input, it simply
recognizes when an attacker tries to break your site and
reacts in exactly the way you want it to. Based on a set of
approved and heavily [...]

PHP Custom List Order

So you have some tabular data printed out in your browser. You can even change the order of the information by clicking on the column name at the top of your list. But can you make your own custom list order?
Or maybe you’re deciding to make a content management system [...]

Regular Expressions (Part1) - Basic Syntax

Table of Contents

1. Regular Expressions Basics
2. Creating Your Own Patterns
3. How Metacharacters Work
4. Quantifier Greediness
5. Pattern Modifiers
6. PCRE vs. POSIX
7. Putting it All Together
8. Conclusion and Future Tutorials

Regular Expressions Basics

What are Regular Expressions?
Regular expressions (which will now be referred to as "regexes") are basically pattern matching inside of text. They use special syntax and [...]

Code Organization

Learn how to organize your code.

Displaying Query Results

Learn how to display query results.

Smilie Insertion

Learn how to use php and mysql to insert smilies.

Skin System

Learn how to build your own skin system in php.

MySQL Basic Commands

Learn basic mySQL commands.

Insert Data into MySQL Database

Learn how to insert data into a database.

PHP Includes

Confused with PHP Include? This can help.

Mysql User System

Build your own mySQL user system.