Category Archives: PHP

Optional constructor parameters

One thing that really irks me about PHP is the way parameters are passed into functions and constructors. A typical constructor will look like this: $col = new Column($id, $label, "50%", true, false); While that’s nice and compact, it’s impossible … Continue reading

Posted in Coding Practices, PHP | Leave a comment

Unit testing with PHP

You’ve probably heard of unit testing. If you are like I was a few years ago, your mouse is hovering over the “close” button right now. But wait! Don’t go away just yet. Over the past few years I have … Continue reading

Posted in PHP, Testing | Leave a comment

Separate display from logic

PHP lets developers write ugly code. And I mean really ugly, unmaintainable, horrific code. I’ve had to work on my share of projects that would make spaghetti code look organized. It doesn’t have to be that way though. Seasoned developers … Continue reading

Posted in PHP | 1 Comment

Spreedly reviewed; New PHP API released

Ever hear of Spreedly? It’s a fantastic service I’ve been using to manage the subscriptions for NeoBudget. Spreedly specializes in one thing: recurring transaction processing, and they do it extremely well A brief review of Spreedly In case you’ve never … Continue reading

Posted in PHP, Spreedly | Leave a comment

Secure username and password authentication with PHP

With PHP-based websites that I create, I use a very simple but secure method for handling authentication. This basic method is secure, protects the privacy of the user, and works with any browser that supports cookies. 1. The database The … Continue reading

Posted in PHP, Security | Leave a comment

Handling PHP form posts

It is very common to handle form posts at the top of a PHP script that prints HTML. This happens most frequently on CRUD screens where a form will post back to itself to handle the updates. There are several … Continue reading

Posted in PHP | Leave a comment

Structure of a PHP website

PHP is free-form and has no imposed structure.  It is just a scripting language. Those familiar with Rails will feel lost with this lack of structure.  It’s easy to just throw another file in the document root to handle a … Continue reading

Posted in PHP | Leave a comment

Is PHP a viable option?

PHP has gotten a bad rap in the past few years, especially from the Rails community.  It’s often seen as the poor-man’s scripting language that should never be used for anything serious. In many ways, I think this is an … Continue reading

Posted in PHP | Leave a comment