Archive for the ‘php’ category

Why Use PHP Caching?

January 10th, 2012 Leave a comment
Why Use PHP Caching?

In the beginning, when the Internet was new, it was easy to create fast HTML web pages that could load easily on a dial-up modem. Once a page was requested, the browser would create a cached version of the site on the computer in a temporary directory and later, should that page be requested again, it would simply serve the cached version instead of making a request to the server. This made everything much faster! Then dynamic pages came onto the scene and messed that idea up. Now we must make requests to our server every time the… View full post »

PHP Optimization Tips: Get the Most Out of Your Applications

December 19th, 2011 Leave a comment 4 comments
PHP Optimization Tips: Get the Most Out of Your Applications

Like any scripting language, PHP can be used in a variety of applications. The down-side for most programmers is that when they learn how to write PHP, they do not always learn how to write PHP with speed and optimization in mind. This article addresses five ways you can improve your code with minor changes that will yield large gains as well as teach you how to become a better PHP developer. One of the most important things you can do when improving PHP application performance is begin measuring your application to find a baseline performance time for different… View full post »

PHP Error Handling Explained

December 8th, 2011 Leave a comment
PHP Error Handling Explained

Error handling is the process of catching errors and unexpected behavior from your program and dealing with them appropriately. When developers write code they always seem to leave error handling for the end instead of making it part of the development process. Part of being a good developer is setting up your applications to handle errors gracefully and without causing trouble for the user. Developers that are new to PHP sometimes complain that there is no built-in error handling functionality, but what they haven’t learned yet is that the functionality is there – you just have to… View full post »

PHP Caching Solutions: Best of the Pack

November 23rd, 2011 Leave a comment 2 comments
PHP Caching Solutions: Best of the Pack

Site performance versus traffic: it is a tough battle to fight. When working with PHP applications we usually have to face this issue sooner or later, as a site becomes more popular it can begin to suffer from performance issues. There are several ways that you can improve your site’s performance to help solve this problem, but one of the easiest ways is to set up PHP caching. PHP Caching is an excellent solution for Web sites that wish to improve their site performance by allowing their dynamic pages to be stored client-side by your application. These solutions… View full post »

PHP Profilers Compared

November 10th, 2011 Leave a comment 3 comments
PHP Profilers Compared

Whether you are an experienced developer or just getting started it is important to know how to measure the performance of your scripts and applications so that you can learn to make improvements and optimizations to your code. There are several tools available, both commercial and free, that will allow you to make these kinds of measurements in your environment. Some tools are very simple and only look at log times to determine how long a request has taken; others have more features and offer full application profiles, query analyzers and execution plans. This article compares two… View full post »

PHP Tutorial: An Introduction to PDO

July 5th, 2011 Leave a comment
PHP Tutorial: An Introduction to PDO

Since its inception, PHP has moved from a procedural language to an object-oriented one; some of its procedural roots, however, still linger. One of these procedural remnants is an antique method of accessing SQL databases; many programmers still use the older mysql and postgresql procedural modules to access databases, and even those who have switched to newer methods, like mysqli, might still be hampered by the fact that such a module only works with mysqli. PHP has since implemented better methods, but many procedural PHP developers are unsure of how to use newer, object-oriented MySQL connection methods. Let’s delve… View full post »

Best PHP Books: My Top 5 Choices

March 28th, 2011 Leave a comment 3 comments
Best PHP Books: My Top 5 Choices

Continuing with our best-five-book series, today we are introducing our pick of the top 5 PHP books. Obviously, PHP has been around much longer than our other review subjects such as Android or HTML5, and there is a greater general variety of books to choose from. PHP is, in many ways, unique in the land of programming languages and web-based application infrastructure. It’s a language that is changing rapidly (the most notable shift being from procedural to OOP in PHP5) but there are surprisingly few books and helpful manuals to help programmers adapt to these changes (as evident by the… View full post »

PHP & MySQL Best Practices for Rock-Solid Applications

March 11th, 2011 Leave a comment 2 comments
PHP & MySQL Best Practices for Rock-Solid Applications

PHP and MySQL are often the preferred technologies for building web applications because they allow you to build robust web applications very rapidly. This rapid development, however, sometimes leads to code that is hard to maintain, doesn’t scale well or performs poorly. Fortunately, there are a few things that you can do early in your application development cycle that will keep your application from developing problems. Follow these PHP/MySQL best practices to build rock-solid applications. Also, keep in mind in general that a bit of extra time invested upfront in keeping your code easily maintainable will save… View full post »

CakePHP Relationships Explained

February 20th, 2011 Leave a comment 3 comments
CakePHP Relationships Explained

If you’ve developed with SQL databases in the past, you’ve probably had experience with the various SQL relationship types: one-to-one, one-to-many and many-to-many. In CakePHP, each database table is typically associated with a model. The relationships between the items in these tables are referred to as associations in CakePHP. CakePHP has an association for each type of relationship. We’re going to look at the four CakePHP associations, how they relate to the traditional SQL relationship and how to work with them in a CakePHP application. To describe these associations, we’ll be using a real… View full post »

PHP and LDAP: How to Manipualte Active Directory

February 13th, 2011 Leave a comment 2 comments
PHP and LDAP: How to Manipualte Active Directory

There is one major question that may be asked to this tutorial’s subject: “Why would I want PHP to access Active Directory? I can use Users and Groups to manage it already.” The answer to this is (though I am sure there are others): Quite often, management wants to delegate some Active Directory (AD) functions to users who don’t or shouldn’t have access to LDAP Users and Groups. As a real-life example, I once worked at a company that wanted their secretary to be able to add users, delete users, and update user passwords and contact info from a… View full post »

PHP Form Data Validation Tips

February 7th, 2011 Leave a comment 2 comments
PHP Form Data Validation Tips

A common web task in web application development is to validate data input by a user. This is usually done to ensure that the type of data entered matches the expected data types for an underlying database. It is also a good security practice to limit the data that a web based form will accept. While it is common in web 2.0 applications to use client side code such as Javascript to validate form fields, this should not be relied on for a number of reasons. Some users disable Javascript so you want to provide a working… View full post »

reCAPTCHA with CakePHP Forms Tutorial

January 14th, 2011 Leave a comment
reCAPTCHA with CakePHP Forms Tutorial

Unfortunately, as a developer today, you have to consider the possibility of spammers using automated scripts to submit the forms on your web site. One popular method for preventing this is to use a CAPTCHA. A CAPTCHA is an image that contains words or an alphanumeric code. The image is often slightly distorted. The user must correctly enter the words or code for the form to be considered valid. This prevents scripts from submitting forms since the CAPTCHA is not readable by automated systems. The most popular system for implementing CAPTCHA is reCAPTCHA by Google. … View full post »

Convert HTML to PDF with PHP and html2pdf

January 3rd, 2011 Leave a comment 4 comments
Convert HTML to PDF with PHP and html2pdf

There are cases when a web application may need to create a custom PDF file. There are several methods for accomplishing this as well. Recently, I worked on a project that involved an employment application. For this project, I needed to provide a HTML preview of the completed application as well as a PDF. Since I was going to be formatting the application with HTML anyway, I wanted to find a method to turn this into a PDF. The solution I found was html2pdf, a series of scripts for turning an HTML page into a… View full post »

CakePHP Installation & Configuration

December 15th, 2010 Leave a comment 1 comment
CakePHP Installation & Configuration

In the past, we have discussed the importance of application frameworks. Frameworks make it easier to write maintainable code and they also provide a shortcut for rapidly developing new web applications. One of the more popular frameworks for use with PHP is CakePHP. CakePHP is a model-view-controller style framework. Structurally, it has many similarities to Ruby based Ruby on Rails web framework. CakePHP is one of the oldest and most robust and stable PHP frameworks on the market. CakePHP is free and open source. They have a manual called the Cookbook that provides… View full post »

PHP 5: Your Visual Blueprint for Creating Open Source, Server-Side Content Book Review

November 3rd, 2010 Leave a comment
PHP 5: Your Visual Blueprint for Creating Open Source, Server-Side Content Book Review

I am often asked for book recommendations by friends and associates wanting to learn new technologies or programming languages. The request I get most often though is for a good book to learn PHP. Recently, I read PHP 5: Your Visual Blueprint for Creating Open Source, Server-Side Content by Toby Joe Boudreaux. I figured it might make a good review for me on the changes in PHP 5 and it looked like a book that I could potentially recommend to new PHP programmers. Visuals This book takes a rather unique approach to teaching PHP 5. It’s part of Wiley’s… View full post »