PHP

Category icon

Escaping input to the PHP mail() function →

Posted on January 15, 2012 in Development with 0 comments.

I recently built my email contact form on this website and thought I would share with you the method which I used to escape input to the PHP mail() function in order to avoid security vulnerabilities on your own contact form. You may think that the mail() function is a relatively safe function and data [...]

Continue Reading →

Category icon

Variable type in PHP and MongoDB →

Posted on November 30, 2010 in Development with 1 comment.

Since working with Mongo I have come across a few small quirks. They are not necessarily good or bad, but simply things you just need to be aware of when working with Mongo. One such quirk is that you need to define your variable type within PHP before you store or fetch data in a [...]

Continue Reading →

Category icon

Accepting RESTful requests with PHP →

Posted on August 23, 2010 in Development with 1 comment.

If you are building an API with PHP and want to make it RESTful, you will quickly find out that default PHP only accepts and parses GET and POST HTTP requests. These are typically used in conjunction with the submission of web forms. By building an API with a strict REST architecture, you are going [...]

Continue Reading →

Category icon

WordPress (and others) are dropping PHP 4 support →

Posted on July 25, 2010 in Development with 0 comments.

For WordPress 3.2, due in the first half of 2011, we will be raising the minimum required PHP version to 5.2. Why 5.2? Because that’s what the vast majority of WordPress users are using, and it offers substantial improvements over earlier PHP 5 releases. It is also the minimum PHP version that the Drupal and [...]

Continue Reading →

Category icon

Would a real PHP style guide, please stand up! →

Posted on July 20, 2010 in Development with 5 comments.

One of the more annoying things about working on and with various different PHP open source projects, is that the majority of them have their own style guides which are not inline with any official PHP style guide. So, as developers, we need to adapt our coding styles to many different standards, depending on which [...]

Continue Reading →

Category icon

How to detect a search engine spider/crawler with PHP →

Posted on January 27, 2009 in Development with 12 comments.

I was tasked with the job of writing a small PHP script today that detects whether a search engine spider is crawling a page of your site. There are a few ways to go about it. The challenging thing about the script is that there are so many spiders on the web. The script I [...]

Continue Reading →

Category icon

PHP code to check if a directory is empty →

Posted on January 14, 2009 in General with 9 comments.

While dealing with files and directories in PHP you will most likely at some point want to check if a folder/directory is empty. To do this, you need to write a script that does the check. There are two ways of doing this. The first is supported in PHP 4 and 5 only and the [...]

Continue Reading →

Category icon

Some useful PHP file and folder functions →

Posted on January 14, 2009 in General with 5 comments.

I have spent the whole day today dealing with files and folder structures with PHP and even though I have dealt with this quite a bit in the past, I still found that I needed to double check some of the functions on PHP.net. So I thought I would create a quick little reference guide [...]

Continue Reading →

Category icon

Running a PHP script in the background →

Posted on January 13, 2009 in General with 4 comments.

I am busy developing a WordPress plugin that will automatically update your WordPress plugins in the background without you ever having to click a button. There will be various settings and you can even select plugins that you do not want to update automatically, but anyway, that is besides the point. Because the process of [...]

Continue Reading →