Writing Solid PHP Code 3 - Avoid the Spaghetti

Unfortunately, a lot of PHP code written today is procedural spagetti code. For smaller applications it may be okay, but larger applications we need to make use of classes. Classes allow you to make new object variables that can perform all the functionality of the class. Take a look at an example of a class: class car { // Define the function... [Read more]

Writing Solid PHP Code 2 - Naming and Style

Having a consistent style makes your PHP code more readable and maintainable. Even in projects where you are the only programmer, once the project progresses to a certain size it can become difficult to maintain. Variable Names Variable names should be very descriptive. They should give anyone that is not familiar with your script to understand what... [Read more]

Writing Solid PHP Code 1 - Error Handling

This is the first in a multiple part series on writing solid PHP code. By solid I mean fast, efficient, maintainable and secure code. This first article deals with error handling. Error handling can stop problems in your application early in their tracks and take appropriate action. Error handling has the added benefit of adding professionalism and... [Read more]

New Knowledge Base

I have just added a new knowledge base. You can see the link to it on the top menu or here. I will be continuously adding answers over time. I have also added functionality to ask your own questions, just click on a topic and ask the question at the bottom of the page. My goal is to slowly build a large collection of information that can be easily searched... [Read more]

How to Create an AJAX Based Voting System

This tutorial describes how to create a voting system with stars like below. We assume you have a web server that can run php scripts, a MySQL database, and a browser with javascript enabled. function HoverStars(item, star) { var starCount; for (starCount=1; starCount Read More →

How to Use .htaccess to Easily Mask Links

This guide assumes you have already setup a website running on an Apache based webserver. If you are using IIS you will need a third party plugin such as IIS Rewrite. Often times you may want to redirect links from your site as opposed to linking directly. This has a few benefits: If you need to change a link’s address you only have to change it... [Read more]

Creating Icons for Your Site

Icons are a great way to establish an identity for your website. On nearly all browser, when you set an icon for your site it will appear next to your site's URL and next to a bookmark. Icons are small (16x16) graphics files saved with the extension .ico. They were first used on Internet Explorer and most browsers haves ince added support for website... [Read more]

Sorry, no posts matched your criteria.