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]

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 →

Installing Apache, MySQL, and PHP on Windows with WAMP (The easy way)

This tutorial explains, step-by-step, how to install Apache, MySQL and PHP on Windows the easy way using WAMP. WAMP is an all-in-one program bundle that includes preconfigured versions of Apache, MySQL, and PHP. Start off by downloading the latest version of WAMP from the WAMP download page. A warning message appears warning you not to install with... [Read more]

Installing PHP 5 for Apache on Windows

This tutorial walks through the process of installing PHP 5 on Apache for Windows. This tutorial assumes you have already installed Apache web server, if you have not then please consult our Installing Apache section. First, download the latest version of PHP from the official website. You can install PHP from the Zip archive but for this article we... [Read more]

Sorry, no posts matched your criteria.