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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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. [...]
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.
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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. [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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. [...]
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.
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
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 [...]
Learn how to organize your code.
Learn how to display query results.
Learn how to use php and mysql to insert smilies.
Learn how to build your own skin system in php.
Learn basic mySQL commands.
Learn how to insert data into a database.
Confused with PHP Include? This can help.
Build your own mySQL user system.