-
Posted: September 2nd, 2010, 7:00am MDT
In this four-part article series, you'll learn about the model-view-controller (MVC) design architecture, why its use is a best practice when building web applications, and how using the Zend framework for PHP lets you make the most of this architecture. This article is excerpted from chapter 25 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Even at this likely early stage of your Web development career, chances are you're already attempting to sketch out the features of a long-desired custom application. An e-commerce store perhaps? An online community forum devoted to stamp collecting? Or maybe something a tad less interesting but non...
-
Posted: September 1st, 2010, 7:00am MDT
Welcome to the conclusion of a five-part series on the Composite View design pattern. This article will focus on a way to make use of this design pattern when you're building dynamic web pages. It involves a simple two-step rendering process.
- As you probably know, one of the great commandments of good object-oriented programming says that whenever possible, Composition must be used over Inheritance, as the latter is an overrated way of reusing code. While its fair to admit that this principle should be used with due caution and, for obvi...
-
Posted: August 31st, 2010, 7:00am MDT
This is part two of a series on Joomla web development in Ubuntu. In the first part, you learned the basic but very important website development skills in Joomla. In this part, you'll learn how to work with templates and other aspects of creating a customized Joomla-based website.
- Just to refresh your memory, the skills covered in the first part included the following:
Changing your password in phpMyAdmin (in case you forget your administrator password).
Changing the default and uploading Joomla templates.
Working with and activating new Joomla templates.
Working wi...
-
Posted: August 30th, 2010, 7:00am MDT
In this fourth part of a series, I demonstrate how to use all the composite view classes defined previously for generating a simple yet dynamic web page using a single rendering method. This example shows the real functionality of the Composite View pattern when it comes to rendering individual web page sections (partials) by using uncluttered, easy-to-follow client code.
- Sharing nearly the same logic as its counterpart Composite (at least at a basic level), Composite View is a clever design pattern that takes full advantage of the functionality provided by Composition to manipulate single and multiple elements of a user interface through the same set of methods. W...
-
Posted: August 26th, 2010, 7:00am MDT
In this conclusion to a three-part series on secure PHP programming, you'll learn how to validate inputs, handle hashing, use the MCrypt package, and more. This article is excerpted from chapter 21 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Converting Input into HTML Entities
The htmlentities() function converts certain characters that have special meaning in an HTML context to strings that a browser can render as provided rather than execute them as HTML. Its prototype follows:
string htmlentities(string input [, int quote_style [,...
-
Posted: August 25th, 2010, 7:00am MDT
This is the first part of a beginner web development tutorial series for Joomla as the content management system used in a website. This tutorial is mainly written for Ubuntu-based developers with an XAMPP installation in a Linux environment. Keep reading to learn how to customize your Joomla website layout.
- If you're planning to work and develop customized Joomla websites in Ubuntu and do not have a local web server installed (LAMP configuration: Linux Apache MySQL and PHP), you can read another tutorial on this site to learn to install XAMPP in Ubuntu.
If you have a fully working XAMPP insta...
-
Posted: August 24th, 2010, 7:00am MDT
In this third part of a series on the Composite View pattern, I develop a concrete class derived from the abstract parent built previously. This new class will be responsible for creating simple view objects.
- The tandem composed of the Composite and Decorator design patterns offers an example that shows where the use of Composition can help in building flexible applications. While decorators are normally used for extending the functionality of objects that are of the same type without having to appeal...
-
Posted: August 23rd, 2010, 7:00am MDT
In this second part of a series, I demonstrate how to create a concrete composite view class, capable of rendering single and multiple view templates via the same render() method. The definition of this brand new class not only shows the logic that drives the Composite View pattern, but reveals how the pattern takes advantage of the benefits offered by Composition.
- As its name suggests, the Composite View design pattern is a subtle variation of the standard Composite, which permits you to manipulate indiscriminately a single view object and a collection of them through the same interface. As with many other popular patterns, the implementation of Composite V...
-
Posted: August 19th, 2010, 7:00am MDT
In this second part of a three-part series on secure PHP programming, you'll learn how to hide the fact that you're using PHP to drive your site, how to hide sensitive data, and more. This article is excerpted from chapter 21 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Hiding PHP
You can also hide, or at least obscure, the fact that youre using PHP to drive your site. Use the expose_php directive to prevent PHP version details from being appended to your Web server signature. Block access to phpinfo() to prevent attackers from learning your software version numbe...
-
Posted: August 18th, 2010, 7:00am MDT
The Yahoo Site Explorer Inbound Links API comes in handy for a variety of purposes. You can get all sorts of data from it using PHP, from counting your backlinks to analyzing where they're coming from. This article will show you how to build a backlink checker tool that can do this and more.
- This is the continuation of a series on the Yahoo Site Explorer Links API tutorial in PHP. It is suggested that you will read and understand the following tutorials if you are new to Yahoo Links API:
Using the Yahoo Site Explorer Inbound Links API
Getting Data from Yahoo Site Explorer Inbound ...
-
Posted: August 17th, 2010, 7:00am MDT
The Composite View design pattern offers users the versatility of handling single objects and collections through the same interface. But some programmers hesitate to use it due to its tricky implementation. Hesitate no longer; this multi-part series will take you step by step through some of the best ways to use the Composite View design pattern, complete with code samples to show you the way.
- Regardless of their specific implementation, which may vary from a programming language to another (and even across different applications), one additional advantage that design patterns offer is that their names give you a pretty clear idea of what they can be used for. Good examples of this can ...
-
Posted: August 16th, 2010, 7:00am MDT
This is the second part of the Facebook PHP API tutorial. The first part ran on August 11. It covered the most basic features, such as adding the basic Facebook Like button, the Recommendations plugin and registering your applications in Facebook to get an Application ID and Secret key. In this part, we'll delve deeper.
- Specifically, we'll go into the details of basic PHP scripting for communicating with the API. After reading this tutorial, you can be confident of how to establish basic communication with the Facebook API, retrieve basic user information and then display that information on your website.
The Ra...
-
Posted: August 12th, 2010, 7:00am MDT
Long before a website goes live, you need to take its online security into consideration -- to be ready for the attackers even before they might gain access. This three-part article series will warn you of what to watch out for, particularly when configuring PHP, and help you to secure your website. It is excerpted from chapter 21 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Any Web site can be thought of as a castle under constant attack by a sea of barbarians. And as the history of both conventional and information warfare shows, often the attackers victory isnt entirely dependent upon their degree of skill or cunning, but rather on an oversight by the defenders. As k...
-
Posted: August 11th, 2010, 7:00am MDT
If you are a PHP developer interested in learning the PHP API applications of Facebook, then this tutorial can help you get started. Keep reading and you'll soon know not only how to add Facebook features to your website, but how to develop your own Facebook applications.
- Facebook API applications can be categorized into three broad features that can be implemented using an API in the PHP programming language.
Integrating Facebook features, widgets and applications in your website (such as allowing your website users to log in using their Facebook account). In ge...
-
Posted: August 10th, 2010, 7:00am MDT
In this conclusion to a five-part article series on Web Services, you'll learn how to create a SOAP server, add server functions, and more. This article is excerpted from chapter 20 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Retrieving the Exposed Methods
The __getFunctions() method returns an array consisting of all methods exposed by the service referenced by the SoapClient object. The prototype looks like this:
array SoapClient- gt;__getFunctions()
The following example establishes a connection to the box...
-
Posted: August 9th, 2010, 7:00am MDT
In this fourth part of a five-part series on Web Services, you'll learn about SimpleXML objects, SOAP, and more. This article is excerpted from chapter 20 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Creating XML from a SimpleXML Object
The
asXML()
method returns a well-formed XML 1.0 string based on the SimpleXML object. Its prototype follows:
string simplexml_element- gt;asXML()
An example follows:
lt;?php
$xml = simplexml_load_file( quot;books.xml quot;);
echo...
-
Posted: August 5th, 2010, 7:00am MDT
In this third part of a five-part series on Web Services, we'll wrap up our discussion of MagpieRSS and move on to SimpleXML, an intuitive methodology for processing XML structures. This article is excerpted from chapter 20 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Limiting the Number of Displayed Headlines
Some Web site developers are so keen on RSS that they wind up dumping quite a bit of information into their published feeds. However, you might be interested in viewing only the most recent items and ignoring the rest. Because Magpie relies heavily on s...
-
Posted: August 4th, 2010, 7:00am MDT
If you've come to Linux Ubuntu from Windows, you probably left behind a few favorite computer games. You may already know that Wine can help you play them again; in some cases, however, the solution is less than perfect.That's where this tutorial can help.
- There are times when, as a Linux user who does not have a Windows-based operating system installed, you would like to play your favorite Windows game in a Linux environment using Wine. Sadly, in most cases, the game will run under less optimal/desirable conditions than when it is executed under Wi...
-
Posted: August 3rd, 2010, 7:00am MDT
Joomla is an award-winning open source CMS that lets you create business or professional-looking websites directly from scratch. Contrast this with WordPress, which by default is a blogging platform and gives websites the appearance of a blog after installation. By the end of this tutorial, you will know how to install a fully running Joomla website directly from scratch using the Linux Ubuntu/XAMPP web server.
- Joomla runs optimally in Apache, MySQL and PHP (LAMPP configuration), the same configuration used by WordPress.
Joomla web development starts in the local host environment. The purpose of this tutorial is to cover the details of installing Joomla in the Linux Ubuntu operating system using XAMPP lo...
-
Posted: August 2nd, 2010, 7:00am MDT
If you're working on a captcha system for your PHP-based website, you may be faced with an interesting challenge. How do you make your system too hard for spam bots to read, but not too hard for humans? This is especially worrying in the wake of bots that can harness OCR for reading captchas. This article explains how to increase the difficulty of a captcha system and test it to make sure it meets your requirements.
- There are many standard captcha solutions available that will work with PHP, including reCaptcha and Asirra captcha.
However, some PHP developers might need to work on their own captcha solution. They can gain overall flexibility and total control of the captcha solution. It also helps the PHP ...
-
Posted: July 29th, 2010, 7:00am MDT
In this second part of a five-part series on Web Services, you will learn how to install and use MagpieRSS, a popular RSS parser. This article is excerpted from chapter 20 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- MagpieRSS
MagpieRSS (Magpie for short) is a powerful RSS parser written in PHP by Kellan Elliott-McCrea. Its freely available for download via
[magpierss.sourceforge.net] and is distributed under the GPL license. Magpie offers developers an amazingly practical and easy means for retrieving...
-
Posted: July 28th, 2010, 7:00am MDT
Asirra (Animal Species Image Recognition for Restricting Access) is a captcha technology developed by Microsoft. This article will explain how it's different from other captcha systems, the benefits of using Asirra, and how to set it up on your PHP-based website.
- Unlike other types of captcha that utilize difficult text obfuscation techniques (such as Google reCaptcha), this system utilizes images of dogs and cats, such as those shown in the screen shot below:
The following are the main benefits of using the Asirra captcha system:
1. It is very...
-
Posted: July 27th, 2010, 7:00am MDT
If you are planning to use PHP to create and interact with a Microsoft Excel spreadsheet application, then you can use the PHP Excel class. It can be a little tricky to use, however, especially for beginners. This tutorial will walk you through the basics and show you how to customize it for your own Excel implementation.
- The class is complex, and sometimes getting started on the basics is hard, because PHPExcel is a complete class that interacts not only with MS Excel but with other formats such as PDF, CSV and the OpenDocument Spreadsheet.
The documentation included by the developers is broad, and does not cover...
-
Posted: July 26th, 2010, 7:00am MDT
If you are looking for a solution to create MS Word documents without the use of .COM objects, then this tutorial will be helpful. In it, you will learn how to build an actual PHP application that can convert a .txt file into a .doc file online.
- Important Requirements
Before you implement this application in your own test server, bear in mind that this was tested to work on the following setup:
PHP Version: 5.2.5
Server: Apache
OS: Linux
MS Word version: MS Word 2002
You will need the following PHP functions/components to ma...
-
Posted: July 22nd, 2010, 7:00am MDT
This five-part article series will introduce you to Web Services. If you've ever wanted to incorporate them into your web sites, this is a good place to start. This article is excerpted from chapter 20 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- This chapter discusses some of the more applicable implementations of Web Services technologies and shows you how to use PHP to start incorporating them into your Web application development strategy right now. To accomplish this goal without actually turning this chapter into a book unto itself, th...
-
Posted: July 21st, 2010, 7:00am MDT
Welcome to the conclusion of a three-part article series that shows you how to implement the Registry design pattern in PHP. In this part, we'll take all the classes that we've created so far and put them to work together.
- So, if you're a PHP developer who wants to expand your current programming skills by learning how to implement the Registry design pattern in a few simple steps without having to deal with obscure and hard-to-grasp concepts, then you've come to the right place.
And now that you know what to expect...
-
Posted: July 20th, 2010, 7:00am MDT
This is a basic tutorial on the application of PHP to get text information from a web form and write it to a text file.
- This article will illustrate a number of features to be included in this application which are useful in actual project implementations, such as:
Restriction of user input to text while blocking unwanted and malicious form inputs.
Limiting the number of words of input that can be written to ...
-
Posted: July 19th, 2010, 7:00am MDT
In this second part of a series, I demonstrate how easy it is to define a session-based registry class based on the abstract parent created in the first tutorial. The straightforward creation process means you shouldnt have major problems building your own registry classes or even improving the ones that you've learned so far in this series.
- Even now, many PHP developers are reluctant to implement the registry design pattern. Using the pattern seems similar to using the quot;evil quot; and deprecated global variables. But the truth is that, when used in a conscientious and responsible manner, the pattern can be really helpful. Its ...
-
Posted: July 15th, 2010, 7:00am MDT
In this conclusion to a five-part series on strings and regular expressions in PHP, you'll learn about padding and stripping a string, trimming characters from a string, counting the characters in a string, and more. This article is excerpted from chapter nine of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Padding and Stripping a String
For formatting reasons, you sometimes need to modify the string length via either padding or stripping characters. PHP provides a number of functions for doing so. This section examines many of the commonly used functions.
Trimming Characters from the Beginning o...
-
Posted: July 14th, 2010, 7:00am MDT
In this first part of a series, I provide a basic introduction to implementing the registry design pattern in PHP. I'll define a simple hierarchy of classes comprised of an abstract registry, and a concrete implementation of it, which uses a private array to save and fetch resources across different points of an application.
- Design patterns are well-trusted and reusable paradigms that allow you to solve common problems present in software development. This is not the only benefit to using design patterns. Many design patterns have intuitive names that permit you to grasp fairly easily what they do or what kind of iss...
-
Posted: July 13th, 2010, 7:00am MDT
PHP can be used to write text to images or even merge a source image to a target image. With this concept, it is possible to create open source ID creation software. The ID can contain a picture of a person and a name tag written in text (or even include an ID number). Keep reading to learn how this can be done.
- To develop and use this application, you will need to have the following:
An ID image template - This will contain a company logo and the text input fields. See sample screen shot below:
The picture of the person can be inserted/merged into the spacious area at the right of the image ID ...
-
Posted: July 12th, 2010, 7:00am MDT
Welcome to the final installment of a series that shows you how to build a simple MVC-based framework in PHP 5. This series walks you in a step-by-step fashion through the development of a stack of reusable components, which can be easily put to work together under a strict MVC-based layer.
- Learning how to implement the Model-View-Controller design pattern within a real-world project can be of great help in sharpening the skills of any web developer who wants to be in touch with modern software programming trends.
So, if youre a PHP coder who wants to grasp the key concepts that sur...
-
Posted: July 8th, 2010, 7:00am MDT
In this fourth part of a five-part series on strings and regular expressions in PHP, you'll learn how to perform complex string parsing, find the last occurrence of a string, and more. This article is excerpted from chapter nine of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Converting an Array into a String
Just as you can use the
explode()
function to divide a delimited string into various array elements, you concatenate array elements to form a single delimited string using the
implode()
function. Its prototype follows:
string implode(string delimiter, ar...
-
Posted: July 7th, 2010, 7:00am MDT
In this next-to-last part of the series, I finish building a MySQL-driven application that uses the functionality of the framework we've created to perform CRUD operations on a database table populated with user-related data.
- Learning how to successfully implement a number of design patterns is definitely a great idea for PHP coders whose main goal is to develop solid and efficient web applications. This includes using the popular Model-View-Controller triad, or expressed in programming jargon, the MVC pattern.
True ...
-
Posted: July 6th, 2010, 7:00am MDT
In this twelfth part of the series I finish building the controller class that permits you to run CRUD operations against the pertinent users MySQL table. This class uses the model to interface with the data layer, the input class to filter incoming data, and the view class to display output on the browser. This process demonstrates the real functionality of the MVC framework developed in previous tutorials.
- Any PHP coder who wants to build thorough, scalable web applications must understand how to implement certain design patterns. This doesnt mean that mastering these patterns will guarantee writing bullet-proof code that scales well in different contexts. But, as the web continues to evolve, desig...
-
Posted: July 1st, 2010, 7:00am MDT
In this third part of a five-part series on strings and regular expressions in PHP, you will learn how to convert strings to and from HTML, and more. This article is excerpted from chapter nine of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Converting Strings to and from HTML
Converting a string or an entire file into a form suitable for viewing on the Web (and vice versa) is easier than you would think. Several functions are suited for such tasks, all of which are introduced in this section.
Converting Newline Characters to HTML...
-
Posted: June 30th, 2010, 7:00am MDT
In this eleventh part of the series, I expand the initial functionality of the user controller class defined previously by adding two simple methods to it. These allow it to create new users in the associated MySQL table.
- If you're a PHP coder who wants to learn how to use the Model-View-Controller design pattern to develop an extensible framework in a few simple steps, then you've come to the right place. This series of articles guides you through the construction of a stack of reusable components, which can be put...
-
Posted: June 29th, 2010, 7:00am MDT
In this tenth part of the series, I start building a basic MySQL-driven application whose main tasks consist of selecting, inserting, updating and deleting records on some hypothetical users by means of the framework we've built.
- As you know, in the last few years the proliferation of PHP frameworks on the web has been so rapid and vast that now a PHP developer has a plethora of options to choose from.
While some frameworks that are more popular than others, all of them try to make PHP programmers' lives much easier by ...
-
Posted: June 28th, 2010, 7:00am MDT
In this ninth part of the series, I add an extensible model class to the framework. This class can be used for running CRUD operations against a selected MySQL database table.
- Learning how to implement the Model-View-Controller design pattern is one of those things that you, as a PHP programmer, will have to face sooner or later, especially if you want to follow modern web development approaches.
The good news is that the learning process doesnt have to be boring. It'...
-
Posted: June 24th, 2010, 7:00am MDT
In this second part of a five-part series on strings and regular expressions in PHP, you'll learn about regular expression functions and a variety of string-specific functions. This article is excerpted from chapter nine of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- PHPs Regular Expression Functions (Perl Compatible)
PHP offers seven functions for searching strings using Perl-compatible regular expressions:
preg_grep()
,
preg_match()
,
preg_match_all()
,
preg_quote()
,
preg_replace()
,
preg_replace_callback()
, and
preg_split()
. These functio...
-
Posted: June 23rd, 2010, 7:00am MDT
In this eighth part of the series, I add to our example MVC-based framework another crucial component. In this case, it's a class that parses data usually injected from a controller and rendered in the form of HTML pages.
- As you may know, the Model-View-Controller design pattern has become one of the most widely-adopted standards for developing web programs that maintain application and business logic isolated from visual presentation.
This structural pattern has gained remarkable popularity, especially with PHP ...
-
Posted: June 22nd, 2010, 7:00am MDT
In this seventh part of the series, I add a cache class to the classes that comprise the MVC-based framework we're building. The new class uses the file system as the underlying backend for caching data, but its also possible to create one that caches data on shared memory, a SQLite database and so forth. Indeed, numerous possibilities exist.
- Without a doubt, the Model-View-Controller design pattern is one of the most useful approaches these days for developing web applications that keep their business and application logic isolated (at least partially) from visual presentation.
As a PHP developer, you may already have mastered the ...
-
Posted: June 21st, 2010, 7:00am MDT
In this sixth part of the series, I finish building a basic HTML form helper class. Doing this adds yet another important component to the sample MVC-driven framework we're developing in this group of tutorials.
- If youre a PHP developer who wishes to learn how to develop an extensible framework that relies on the structure of the Model-View-Controller design pattern to separate business and application logic from visual presentation, then you've come to the right place.
Welcome to the sixth installment ...
-
Posted: June 17th, 2010, 7:00am MDT
Strings and regular expressions are among the basic tools that help programmers get their jobs done. This five-part article series covers how these are used in PHP. It is excerpted from chapter nine of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Programmers build applications that are based on established rules regarding the classification, parsing, storage, and display of information, whether that information consists of gourmet recipes, store sales receipts, poetry, or some other collection of data. This chapter introduces many of the PHP...
-
Posted: June 16th, 2010, 7:00am MDT
Submitting XML sitemaps to Google Webmaster Tools is an important webmaster activity. Google recommends using it to help it find new content in your website which otherwise cannot be crawled by Googlebot. This is particularly helpful if you have a fairly large website. In this article, you'll learn how to generate such a sitemap with PHP.
- If you are new to XML sitemaps or need more information about Google XML sitemap generation, you should read this tutorial before going any further.
This tutorial helps you develop your own PHP-based Google XML Sitemap generator. This is a customized approach, which means that you can feed the ap...
-
Posted: June 15th, 2010, 7:00am MDT
In this fifth episode of the series, I start building an HTML form helper class to add to this sample MVC framework the ability to render some basic form elements.
- Since the web is in constant evolution, developing applications for it often requires mastering different disciplines that range from using client-side technologies such as (X)HTML, CSS and JavaScript, to working with server-side languages like PHP, Ruby and SQL, among others.
While all of these t...
-
Posted: June 14th, 2010, 7:00am MDT
In this fourth part of the series, I show you how to provide this sample MVC-driven framework with the ability to sanitize user input by way of a basic input class.
- As you may know, the Model-View-Controller design pattern is one of the most popular standards used nowadays for building web programs that keep business and application logic isolated from visual presentation. The great news about this structural paradigm is that you, as a PHP developer, can also ...
-
Posted: June 10th, 2010, 7:00am MDT
In this conclusion to a four-part series on parsing and regular expression basics in Perl, we finish our study of regular expressions; you'll even learn how to create your own. This article is excerpted from chapter one of the book Pro Perl Parsing, written by Christopher M. Frenz (Apress; ISBN: 1590595041).
- Regexp::Common::Comments
This module generates regular expressions that match comments inserted into computer code written in a variety of programming languages (currently 43). The syntax to call these regular expressions is as follows, where refers to the base comment matching functionality and...
-
Posted: June 9th, 2010, 7:00am MDT
In this third part of the series, I further enhance the functionality of this sample MVC framework by adding a class to it that takes care of interacting with MySQL in a simple manner. Youll see the importance of this abstraction class when I show you the definition of the corresponding model, which will aggregate an instance of MySQL to handle the data layer very easily.
- Despite how intimidating this task may sound to you, building a framework in PHP 5 that follows the structure imposed by the Model-View-Controller design pattern is much easier than you may think.
So, if youre interested in learning the key concepts that surround this process, either for building...
-
Posted: June 8th, 2010, 7:00am MDT
In this second part of the series, I add another crucial component to this example MVC-driven framework. It's a basic router/dispatcher class. While the incorporation of this brand new module turns the framework into a more functional piece of code, there are other components that still need to be developed.
- Given the huge number of MVC-driven PHP frameworks available these days, which come loaded with lots of powerful features aimed at speeding up the development of web applications, its fair to think that building software packages like these may be a difficult and demanding task.
While this is und...
-
Posted: June 7th, 2010, 7:00am MDT
In this first part of a series, I develop the first module of a model-view-controller (MVC) driven framework, which happens to be a front controller. By combining this component and a basic .htaccess file, its possible to route all HTTP requests to the (still-undefined) dispatcher class.
- As you may know, one of the most popular approaches that can be taken for speeding up the development of PHP applications without having to start coding them from scratch is using either a proprietary or a third-party framework. Yes, nowadays PHP frameworks are available in so many flavors and sizes...
-
Posted: June 3rd, 2010, 7:00am MDT
In this third part to a four-part series on parsing and regular expressions in Perl, you will learn about cloistered pattern modifiers, boundary assertions, troubleshooting regular expressions, and more. This article is excerpted from chapter one of the book Pro Perl Parsing, written by Christopher M. Frenz (Apress; ISBN: 1590595041).
- Cloistered Pattern Modifiers
In the previous section, you saw how to apply pattern modifiers to an entire regular expression. It is also possible to apply these modifiers to just a portion of a given regular expression; however, the syntax is somewhat different. The first step is to define the s...
-
Posted: June 2nd, 2010, 7:00am MDT
Organize a collection of data somehow for later usage and you will get a database. In the last couple of years, with the spread of the Internet, databases have become something you will come across everywhere on the World Wide Web. Most websites have a strong database behind them. With this phase of the web's evolution, if you work in software development, eventually you will need to create and plan a database from scratch. This article is here to teach you and show you what traits a solid plan should have.
- To start, we need to separate the concept of data and information. While in the everyday usage these two merge, in the world of databases these are two very separate things. Data is the representation of facts/concepts of stuff that is adequate for human or automatic (by a machine) processing. The i...
-
Posted: June 1st, 2010, 7:00am MDT
The open source community has a new tool to tinker with thanks to the release of Fedora 13 from the Fedora Project. The Fedora Project is a group dedicated to bringing free open source software to the public. They are continuing to do so with this current release, which comes just half a year after the release of Fedora 12.
- Fedora 13 is the latest edition of the free Linux-based operating system from the group. Anyone can download and use the operating system. They are also free to modify it to their needs and distribute it as they see fit. Fedora 13 is just the latest way that the Fedora Project encourages the innovat...
-
Posted: May 27th, 2010, 7:00am MDT
In this second part of a four-part series on parsing and regular expression basics in Perl, you'll learn about quantifiers, modifiers, and more. This article is excerpted from chapter one of the book Pro Perl Parsing, written by Christopher M. Frenz (Apress; ISBN: 1590595041).
- Quantifiers
As you saw in the previous section, you can create a simple regular expression by simply putting the characters or the name of a variable containing the characters you seek to match between a pair of forward slashes. However, suppose you want to match the same sequence of characters ...
-
Posted: May 26th, 2010, 7:00am MDT
Late Static Bindings (LSB), a powerful feature bundled with PHP 5.3, are much easier to master than you might think. Achieving intimate knowledge of them requires only an average background in working with objects and classes. This article concludes a six-part series that shows you what you can do with LSB.
- So, if you're a developer interested in grasping the key concepts that surround the implementation of LSB, then I recommend you start reading this article series right now. Through its tutorials you'll learn how to take advantage of the functionality offered by LSB to create flexible hierarchies ...
-
Posted: May 25th, 2010, 7:00am MDT
In this fifth part of a six-part series on late static bindings, I define some sample classes which are responsible for creating some block-level (X)HTML objects, such as simple divs and paragraphs. Once we get these classes up and running, we'll be ready to test the factories created in the previous part and see if theyre actually as functional as they look.
- As youll possibly know, PHP 5.3 includes, among a few other useful things, a new feature called Late Static Bindings (LSB). It comes in handy for resolving at runtime from which class a given static method has been called. Even though this major release of the language also offers a solid support fo...
-
Posted: May 24th, 2010, 7:00am MDT
In this fourth part of the series, I demonstrate how Late Static Bindings can be useful for implementing the abstract factory design pattern. The feature will be used at the instance level within the constructor of an abstract factory class, where at least one of its concrete implementations is tasked with factoring a couple of block-level (X)HTML objects, such as divs and paragraphs.
- Among the new features that have been packaged with PHP 5.3, theres one that turns out to be remarkably useful during the development of object-oriented applications. It allows programmers to efficiently solve common issues that occur when its necessary to deal with hierarchies of classes in a sta...
-
Posted: May 20th, 2010, 7:00am MDT
Parsing helps us to extract the information we need from the mounds of data available. Regular expressions assist us in the hunt. This four-part article series will show you how to use Perl with regular expressions to accomplish your parsing tasks. It is excerpted from chapter one of the book Pro Perl Parsing, written by Christopher M. Frenz (Apress; ISBN: 1590595041).
- The dawn of a new age is upon us, an information age, in which an ever-increasing and seemingly endless stream of new information is continuously generated. Information discovery and knowledge advancements occur at such rates that an ever-growing num
ber of specialties is appearing, and in many fie...
-
Posted: May 19th, 2010, 7:00am MDT
In this third part of a series on late static bindings, you will learn how to use the get_called_class() function bundled with PHP 5.3 for determining at runtime which class has been called in a static context. In certain situations this function can be used as a replacement for late static bindings, but LSB has a wider range of possible uses; keep this in mind when developing your own object-oriented applications.
- If you ask a group of developers whats so exciting about PHP 5.3, its very probable they'll tell you that this major upgrade of the language now supports native namespaces and anonymous functions. While these enhancements have been widely commented on and discussed in blogs and forums everywhere,...
-
Posted: May 18th, 2010, 7:00am MDT
In this second part of the series, I show you how useful late static bindings can be for dealing with a hierarchy of classes in static environments. In this case, the classes that compose that hierarchy are simple implementations of the registry design pattern, but this feature can be utilized in different situations and yield similar results.
- The release of PHP 5.3.0 a few months ago put a big smile on the face of many developers. This major upgrade of the language has been packaged with some new and exciting features that allow you to build more robust and reliable applications, particularly when using the object-oriented paradigm. By ...
-
Posted: May 17th, 2010, 7:00am MDT
PHP 5.3 introduced a number of valuable features to the popular and constantly developing language, but some of them seem less useful at first glance than they actually are. Late static bindings fall into this category. This article series shows you how to unlock the true power of LSB to work for you.
- Without a doubt, PHP is in steady and constant evolution. Its dynamic nature is one of the most relevant factors that has contributed to turning it into the mature language that we see nowadays. This doesnt mean that its API is a beautiful model of consistence and efficiency, though, especially w...
-
Posted: May 13th, 2010, 7:00am MDT
If you're interested in installing the Debian GNU/Linux distribution, you'll want to know that the Knoppix installer can save you a lot of trouble. This article walks you through the process. It is excerpted from the book Knoppix Hacks, Second Edition: Tips and Tools for Hacking, Repairing, and Enjoying Your PC, written by Kyle Rankin (O'Reilly, 2009; ASIN: B002QX441K). Copyright © 2009 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media
- Once you are comfortable using Knoppix for your desktop, you might find yourself booting onto the CD more often. While you can create persistent settings and a portable home directory to mount, at some point you might decide you would like to use Knoppix full-time by installing it to your hard drive...
-
Posted: May 12th, 2010, 7:00am MDT
In this conclusion to a three-part series on Python 3.1, you'll learn how to format strings and put them together in different ways. We'll also review what we covered in the series as a whole, which includes your first Python program. This article is excerpted from the book Beginning Python: Using Python 2.6 and Python 3.1,, written by James Payne, Developer Shed Editor-in-Chief (Wrox, 2010; ISBN: 0470414634).
- If you like what you're reading here, you can find it at Wrox or purchase the entire book at Amazon.
Putting Strings Together in Different Ways
Another way to specify strings is to use a format specifier. It works by putting in a special sequence of characters that Python will interpret as a ...
-
Posted: May 11th, 2010, 7:00am MDT
In this second part of a three-part series that introduces you to Python, you'll learn about the importance of strings, how they work, and why Python uses three different kinds of quote marks. It is excerpted from the book Beginning Python: Using Python 2.6 and Python 3.1,, written by James Payne, Developer Shed Editor-in-Chief (Wrox, 2010; ISBN: 0470414634).
- If you like what you're reading here, you can find it at Wrox or purchase the entire book at Amazon.
What is a String?
A string is one of several data types that exist within the Python language. A data type, as the name implies, is a category that a particular type of data fits into. Every type o...
-
Posted: May 10th, 2010, 7:00am MDT
Ready to take your first steps in Python? This three-part article series walks you through the basics, introducing important concepts such as strings. In this first part, you'll learn how programming is different from using a computer, how to install Python, and how to start using the Python shell. It is excerpted from the book Beginning Python: Using Python 2.6 and Python 3.1,, written by James Payne, Developer Shed Editor-in-Chief (Wrox, 2010; ISBN: 0470414634).
- If you like what you're reading here, you can find it at Wrox or purchase the entire book at Amazon.
How Programming is Different from Using a Computer
The first thing you need to understand about computers when youre programming is that you control the computer. Sometimes the computer doesnt do...
-
Posted: May 6th, 2010, 7:00am MDT
In this second part of a two-part series on hashes in Perl, you'll learn about hash functions and hashes in different contexts. This article is excerpted from chapter five of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- Hash in List Context
When we discussed lists and arrays, we spent a lot of time talking about the difference between list and scalar context. Lets look at what happens when we evaluate a hash in list context. This is demonstrated with the following program:
#!/usr/bin/perl -w
# listcontext.pl...
-
Posted: May 5th, 2010, 7:00am MDT
This is an important tutorial on how to install and completely configure XAMPP to run without problems on Ubuntu Linux.
- To proceed please make sure you have the following requirements:
Linux Ubuntu operating system - This tutorial has been written using Ubuntu 9.10 - Karmic Koala.
XAMPP Linux Version installer - You can go to the XAMPP Linux Page and use the actual download link.
At the time this tutorial ...
-
Posted: May 4th, 2010, 7:00am MDT
Using a MySQL GUI (Graphical User Interface) makes it easier, more efficient and user-friendly to work with a MySQL database. The two most popular MySQL GUIs, HeidiSQL and MySQL Query Browser, have their default connections to any MySQL server unencrypted. This is a problem, but we're going to fix it; just keep reading.
- This tutorial will help you configure these two important MySQL GUIs to connect and do sessions in the SSH (Secure Shell) protocol. This will ensure that communication to your MySQL server is encrypted. Encrypted communication ensures the integrity and security of your data against unauthorized ...
-
Posted: May 3rd, 2010, 7:00am MDT
There are some hosting companies that do not offer an SSL (Secure Socket Layer) environment for MySQL. It is important to have an SSL environment for MySQL, because your sessions are protected with encryption. Fortunately, if you can't get SSL with your hosting company, there is an alternative: SSH.
- The Secure Socket Layer security feature protects sensitive information (such as credit card information, passwords, SS numbers, etc.) from falling into the hands of an unauthorized third party that might be sniffing the packets as it travels the Internet.
Below are some standards that most MyS...
-
Posted: April 29th, 2010, 7:00am MDT
Hashes in Perl aren't really that hard to understand; they're not that much harder than understanding how a phone book works. This article introduces you to hashes, what they do, and how to use them. It is excerpted from chapter five of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- We have talked about two types of data: scalars and arrays. Scalars are single pieces of infor
mation, while arrays are single variables containing many different values.
Alternatively, some things are better expressed as a set of one-to-one correspondences. A phone book, for example, is a set of...
-
Posted: April 28th, 2010, 7:00am MDT
Being one of the most popular contenders in the exciting, but very often complex, terrain of software design, the Strategy design pattern is a well-trusted paradigm. It allows you to build more flexible and efficient applications by appealing to the functionality of two of the big pillars of solid object-oriented programming: favoring Composition over Inheritance, and encapsulating the concepts that vary. This is the conclusion to a six-part series that shows you how to use the Strategy design pattern to validate incoming data.
- As with other design patterns, the implementation of the Strategy pattern isn't subject to a specific programming language or context, and in fact it may vary slightly from case to case. This doesn't imply, though, that its use in real-world projects must be a painful and annoying experience. In rea...
-
Posted: April 27th, 2010, 7:00am MDT
In this penultimate part of the series, I will build a strategy class that validates URLs using the built-in PHP function filter_var(). This process is similar to defining other strategy classes discussed in previous parts, so you shouldnt have major difficulties understanding its underlying logic.
- As a PHP developer, did you ever think that implementing the Strategy design pattern in a real-word case was a daunting task that would make you suffer premature hair loss? Well, fear not; in this article series you'll learn how to build a customizable web application which will use a bunch of...
-
Posted: April 26th, 2010, 7:00am MDT
In this fourth part of a series on the strategy design pattern, I extend the functionality of the sample validation program by adding another strategy class to it. The new class will check the validity of a supplied email address.
- As you may have heard, the Strategy design pattern is a software design paradigm that allows developers to build flexible and modular applications by taking advantage of the functionality offered by Composition, rather than relying heavily on the benefits brought by Inheritance. While this may sound...
-
Posted: April 22nd, 2010, 7:00am MDT
In this conclusion to a five-part series on scalars in Perl, we'll put everything we've learned together to build a currency converter. This article is excerpted from chapter two of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- Multiple Assignments
Weve said that
=
is an operator, but does that mean it returns a value? Well, actually it does, it returns whatever was assigned. This allows us to set several variables up at once. Heres a simple example of this; read it from right to left:
$d = $c = $b = $a = 1;
Firs...
-
Posted: April 21st, 2010, 7:00am MDT
In this third part of a series on validating incoming data with the strategy design pattern, I create a brand new strategy class that can check whether or not a supplied input value is a float number. The addition of this class extends the capabilities of the sample validation program that Im building in this series.
- Design patterns are well-known, reusable paradigms that allow developers to solve certain problems in a more efficient way, even though their implementation is flexible and not tied to a specific programming language. Due to their variety, they can be placed in different categories (creation, stru...
-
Posted: April 20th, 2010, 2:00pm MDT
In today's world, it seems as if everyone is on the go. The introduction of smart phones and other mobile devices with increasing capability and technology seems to fit the idea that the mobile market is the way of the future. So where is Linux when it comes to mobile technology?
- One person who believes that the mobile market is the way of the future is Google's CEO Eric Schmidt. The recent Atmosphere conference, where many technology leaders presented new thoughts and ideas, was where Schmidt expressed the sentiment of increasing mobile importance.
To summarize, Schmidt...
-
Posted: April 20th, 2010, 7:00am MDT
If youre a PHP developer who wants to learn how to implement the Strategy design pattern in a real-world project, then you might want to take a look at this article series. Over the course of its six tutorials, youll walk through the development of a modular and flexible application, which will use this powerful pattern to validate different types of data, including integer and float numbers, email addresses and URLs.
- And now that you've been introduced to the subject covered by this series, its time to review the topics covered in the first tutorial, in case you havent read it yet. In that part I explained in depth the logic that stands behind the Strategy pattern, as well as how to use it for checking the v...
-
Posted: April 19th, 2010, 7:00am MDT
Welcome to the final installment of a series that provides an overview of the Iterator, Countable and ArrayAccess SPL interfaces in PHP 5. Made up of six parts, this series teaches you how to build a fully-working MySQL abstraction class that takes advantage of the methods inherited from these native interfaces to manipulate database record sets easily by using an array syntax.
- In the articles that preceded this one I demonstrated in a step-by-step fashion how to develop such a MySQL handling class. It effectively defined all of the methods required by the aforementioned interfaces. In doing so, the class now is not only capable of traversing data sets by way of a plain ...
-
Posted: April 15th, 2010, 7:00am MDT
In this fourth part of a five-part series on scalars in Perl, you learn how to compare the value of strings; we'll also wrap up our discusssion of operators and move on to variables. This article is excerpted from chapter two of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- String Comparison
As well as comparing the value of numbers, we can compare the value of strings. This does not mean we convert a string to a number, although if you say something like
quot;12 quot; gt; quot;30 quot;
, Perl will convert to numbers for you. This means we can compare the stri...
-
Posted: April 14th, 2010, 7:00am MDT
If youve been doing some research lately on the web about how to implement different design patterns, be it in Java, PHP or Python, you'll probably have noticed that the Strategy pattern is one of the most popular contenders in the field. It has been covered countless times in all types of media, ranging from books and magazines to e-zines and personal blogs. In this article series, I'll show you how to use this popular design pattern to accomplish one of the more common tasks a website must perform: validating user-supplied data.
- Logically, theres a reason for the Strategy design pattern's well-deserved popularity: unlike the Composite and Decorator patterns, which are also important to pattern-driven programming, the logic that stands behind Strategy is much easier to grasp, and its implementation in several languages is f...
-
Posted: April 13th, 2010, 7:00am MDT
Weve discussed Googles Android Operating System before as it pertains to Verizon partnering with the tech giant or the systems specific capabilities, but theres a lot to catch up on, as is often the case with Google. There are now a ton of Droid systems already on the market, with more coming. Keep reading as we take a closer look at the state of the market.
- Not only is the Droid system most favored among developers (as well soon learn), but since the operating systems release in October of 2008, an unprecedented number of smartphones (and e-readers, among a few other gadgets) now use the system. By the end of 2009, Google expected there to be 18 Androi...
-
Posted: April 12th, 2010, 7:00am MDT
In this fifth part of a six-part series on the Iterator, Countable and ArrayAccess SPL interfaces, I implement the rest of the methods declared by the ArrayAccess SPL interface within the MySQLi_ResultWrapper class that you saw in a previous part. Once this process is completed, the class will be able to treat records in database result sets as if they were plain array elements.
- If youre a PHP developer who frequently builds object-oriented web applications, then its possible that youve already worked with user-defined interfaces. PHP 5 offers strong support for them, among the numerous features that make up its highly-enhanced object model.
However, the support for in...
-
Posted: April 8th, 2010, 7:00am MDT
In this third part of a five-part series on scalars in Perl, we continue our study of operators, moving on to Boolean and string operators. This article is excerpted from chapter two of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- The NOT Operator
Finally, you can flip the number completely, and replace all the 1s by 0s and vice versa. This is done with the not, or ~, operator:
85 01010101
170 10101010
Lets see, however, what happens when we try this in Perl:
#!/usr/bin/perl -w
# bitop2.pl
print q...
-
Posted: April 7th, 2010, 7:00am MDT
Welcome to the final part of a series on implementing the Data Mapper design pattern in PHP 5. This series teaches you the key concepts that surround the development of data mapper classes. It complements the corresponding theory with a decent variety of code samples.
- And now that you've been introduced to the primary goal of this series, its time to review the topics that were discussed in the previous part. In the course of that tutorial I finished building a basic data mapper class, which in this particular case was responsible for mapping user domain object...
-
Posted: April 6th, 2010, 7:00am MDT
In this fourth part of a six-part series, that covers the Iterator, Countable, and ArrayAccess SPL interfaces, I show how to partially implement the methods declared by the ArrayAccess SPL interface within a sample class that manipulates MySQL result sets.
- This isn't breaking news certainly, but as you may have heard, PHP 5 comes packaged with a powerful set of functions, classes and interfaces commonly know as the Standard PHP Library (SPL), which can be used for tackling typical problems present in day-to-day programming without having to reinvent t...
-
Posted: April 5th, 2010, 7:00am MDT
Welcome to the final part of a series on the Reflection API. Through a decent variety of functional code samples, this series shows you how to take advantage of the power offered by reflection to analyze the internal structure of your classes and interfaces by using an object-oriented approach.
- And now that you've been introduced to the main goal of this series, I'd like to spend a few moments refreshing the topics that were covered in the last article. In that tutorial I explained how to utilize a couple of methods included with the reflection API to determine if a specified class was de...
-
Posted: April 1st, 2010, 7:00am MDT
In this second part of a five-part series on scalars in Perl, you'll learn about operators (both arithmetic and bitwise), among other things. This article is excerpted from chapter two of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- Alternative Delimiters
Thats all very well, of course, until we want a / in the string. Suppose we want to replace Slashdot with /. now were back where we started, having to escape things again. Thankfully, Perl allows us to choose our own delimiters so we dont have to stick with
//
. Any n...
-
Posted: March 31st, 2010, 7:00am MDT
In this penultimate part of the series on the data mapper design pattern, I demonstrate how to provide the UserMapper class we've previously created with the ability to delete users from its associated MySQL table.
- Superbly described in Martin Fowler's book Patterns of Enterprise Application Architecture, Data Mapper is a powerful database access pattern aimed at keeping domain objects isolated from the underlying storage mechanism (in most cases a relational database). This permits developers to build multi...
-
Posted: March 30th, 2010, 7:00am MDT
In this third part of a seven-part series on the Iterator, Countable and ArrayAccess SPL interfaces, I give the MySQLi_ResultWrapper class developed in the previous part the capability of counting the number of rows contained in a given result set. I'll do that by implementing the count() method declared by the Countable interface. Doing this will make it possible to use an instance of the class to traverse data sets and count records as if they were plain PHP arrays, which is quite appealing to client code that works with the classs API.
- As you possibly know, the Standard PHP Library (also know simply by its acronym, SPL) is comprised of a powerful set of functions, classes and interfaces that permit developers to address problems that occur frequently during the development of web programs. Ranging from autoloading classes on deman...
-
Posted: March 29th, 2010, 7:00am MDT
In this sixth part of a seven-part series, I explain how to use the power of reflection to find out if a class has been defined abstract and final, and if it implements a specified interface. Performing all of these tasks is a straightforward process, so you shouldnt have major problems using these reflection methods within your own PHP applications.
- When it comes to highlighting the most remarkable features incorporated into PHP 5 a few years ago, undoubtedly its enhanced object model, along with the support for native exceptions and interfaces, are the first things that come to mind. However, as you may have heard, the language also comes wi...
-
Posted: March 25th, 2010, 7:00am MDT
If you're writing a program that involves computation, you're going to come face to face with some basic programming concepts. This article, the first of a five-part series, will explain scalars, one of the basic ideas of programming in Perl. It is excerpted from chapter two of the book Beginning Perl, written by James Lee (Apress; ISBN: 159059391X).
- The essence of programming is computation we want the computer to do some work with the input (the data we give it). Very rarely do we write programs that tell us something we already know. Even more rarely do we write programs that do nothing interesting with our data at all. So, if were going to w...
-
Posted: March 24th, 2010, 7:00am MDT
In this third part of a five-part series on the data mapper design pattern, I start developing a basic user mapper class. This class allows you to map user domain objects to their associated database table in a fairly easy way.
- The Data Mapper design pattern is a powerful and elegant solution that permits developers to isolate domain objects from the underlying persistence storage mechanism of an application. Its implementation, at least at a basic level, is a pretty straightforward process that can be tackled with minor ...
-
Posted: March 23rd, 2010, 7:00am MDT
Welcome to the final installment of a series that shows you how to use restrictive constructors in PHP 5. With a decent variety of code samples, this series recreates for you a few common scenarios where the implementation of both protected and private constructors can greatly improve the behavior of different classes in the context of a given application.
- And now that you've been properly introduced to the subject of this series, its time to briefly recapitulate the topics that were covered in the last tutorial. In that part of the series I built a basic MySQL abstraction class, which used a private constructor in conjunction with a static method c...
-
Posted: March 22nd, 2010, 7:00am MDT
In this fifth part of the series you will learn a couple of additional methods included with the PHP reflection API. The first one will allow you to check the existence of a specified class property, and the second one will permit you to retrieve all of the static properties defined by that class at once.
- Frankly speaking, the powerful reflection library that comes included with PHP 5 is one of those features that you, as a web developer, cant live without once youve discovered its real functionality. While is fair to say that in the old days of PHP 4, the language already provided some native functi...
-
Posted: March 18th, 2010, 7:00am MDT
In this second part of a series, I make the MySQLi_ResultWrapper class a full implementer of the Iterator SPL interface. Implementing the rest of the methods declared by the interface is a straightforward process that allows us to traverse MySQL result sets by using a plain foreach construct.
- As you may know, the Standard PHP Library (commonly know as SPL) provides developers with a powerful set of native classes and interfaces that can be used for easily tackling problems that come up in everyday programming, such as autoloading resources on request, traversing recursively directories...
-
Posted: March 17th, 2010, 7:00am MDT
In this second part of a five-part series I go one step further in the implementation of the Data Mapper design pattern in PHP 5. Specifically, I build a simple MySQL abstraction class which performs a few common tasks. These include connecting to the database server and running hard-coded queries, fetching database rows and so forth.
- Put in a simple way, the Data Mapper design pattern is an elegant solution that allows developers to keep all of the domain objects handled by an application separate from the underlying persistence layer. This characteristic is commonly known as persistence ignorance. As with many other patterns...
-
Posted: March 16th, 2010, 7:00am MDT
In this third installment of a four-part series, I show you that a private constructor can be truly helpful when strictly implementing the Singleton design pattern. In this case, the pattern will be applied within a class that behaves like a simple MySQL abstraction layer, but the same concept can be extended to other classes.
- At first sight, declaring a constructor method protected or private in PHP 5 seems to be a rather irrelevant and even boring topic. The process doesnt differ too much from specifying one of those levels of restriction for a regular class method. However, this first impression may be misleading.
...
-
Posted: March 15th, 2010, 9:58pm MDT
As the iPad nears its shipping date, iPad developers are flocking to the Objective-C platform and Apple's SDK 3.2
- Using the same development platform as the iPhone, the iPad has caused a marked surge in use of the iPad development software and emulators almost as strong as the market is picking up the actual iPad units.
The iPad itself sold well over 155,000 units in just over three days. Developer's interes...
-
Posted: March 15th, 2010, 7:00am MDT
In this fourth part of a seven-part series, I demonstrate how to use the PHP reflection API to retrieve useful information about the properties declared by a specific class. Reflection allows you to do more with properties of a class than determine their visibility or learn the values assigned to them, but that's what we'll be covering here.
- In case youre not aware of it, among the many enhancements and helpful features that were added to PHP 5, theres one that has been unfairly overlooked by many developers. This might be because at first glance it doesn't seem to be as useful as the others. Yes, as this articles title suggests, Im t...
-
Posted: March 11th, 2010, 7:00am MST
In this first part of a short series, I'm going to introduce you to using the Iterator, Countable and ArrayAccess interfaces that come with the Standard PHP Library. You'll see how to implement some of the methods declared by the Iterator interface within a class that manipulates MySQL result sets via an intuitive API.
- For many PHP developers eager to apply the object-oriented paradigm in a more thorough and consistent manner, the release of PHP 5 brought a number of handy features that allowed them to achieve this goal in a truly painless fashion. This isnt breaking news, of course, but the inclusion of member ...
-
Posted: March 10th, 2010, 7:00am MST
In this first part of a five-part series, I introduce you to implementing the Data Mapper design pattern in PHP 5. This pattern attempts to solve the issue of the strong coupling that often exists between the domain objects present in an application and the underlying persistence mechanism. This benefit comes at a cost, since data mappers add a new layer of complexity. Living with this minor trade-off is quite worthwhile, though, as you'll see.
- Since the web is in constant evolution and merges a variety of technologies and languages, developing web applications (specially mid-sized and large-scale ones) has become a challenging process. Indeed, applications require extensive planning, modeling and testing, before reaching a stable depl...
-
Posted: March 9th, 2010, 7:00am MST
In this second part of a four-part series, I rebuild the example application developed in the previous tutorial. As you'll recall, it used a protected constructor to prevent the instantiation of the base array iterator class. In this case, a better result will be achieved by declaring the iterator abstract; still, the example demonstrates a simple utilization of a restrictive constructor in a concrete situation.
- Unquestionably, the introduction of a more robust object model in PHP 5 has provided developers with additional features that allow them to build efficient and thorough object-oriented applications without the need to appeal to the ugly programming hacks used frequently in the bad old days of PHP ...
-
Posted: March 8th, 2010, 7:00am MST
This third part of a seven-part series explores the methods of the PHP Reflection API. You will learn how to take advantage of their functionality to retrieve useful information about the methods defined by a reflected class.
- One of today's most powerful approaches for retrieving information about the internal structure of classes and interfaces in PHP 5 is via the language's native reflection API. What's more, not only does this API comes packaged with a huge variety of methods that let developers perform all sorts of ...
-
Posted: March 4th, 2010, 7:00am MST
What exactly is a restrictive constructor, and why would you want to use one? If you're a PHP programmer who uses such design patterns as Singleton and Factory, this series of articles on restrictive constructors will give you another tool to use in your applications.
- As you'll probably know, with the release of PHP 5 quite some time ago, the language was provided with the ability to specify the visibility of properties and methods in classes, something that had already been implemented in more mature programming languages such as Java and C++.
In a pretty str...
-
Posted: March 3rd, 2010, 7:00am MST
In this second part of a series, I explore some handy methods of the PHP Reflection API. They allow you to retrieve miscellaneous information about a class, including its name and containing file, as well as its starting and ending lines.
- Overlooked by many developers, the Reflection API that comes with PHP 5 is a powerful reverse-engineering extension of the language that permits developers to analyze, inspect and retrieve valuable information about selected classes and interfaces by means of a set of convenient methods.
So, if y...
-
Posted: March 2nd, 2010, 7:00am MST
In this first part of a series, we'll begin exploring some of the methods included with the Reflection API bundled with PHP 5. The interface allows developers to collect relevant information about a reflected class, including its name, its declared constants and properties, in a extremely straightforward way.
- Even though PHP is intrinsically a weakly-typed language, as it doesnt internally impose any constraints on the types of values that can be held by a given variable (with the exception of type hinting and type casting), its introspective capabilities are quite impressive indeed. Native old functio...
-
Posted: March 1st, 2010, 7:00am MST
Welcome to the final part of a ten-part series that shows you how to use the Swift Mailer library to build email applications. This final part of the series will explain how to use the batchsend() method, and how to specify the Return-path MIME header within emails.
- Frankly speaking, building a full-featured email application with PHP has always been a challenging task, even for seasoned developers. The process often demands that developers deal directly with the internals of both the SMTP and POP3 protocols, and it's worse if the application must provide su...
-
Posted: February 25th, 2010, 7:00am MST
In this ninth part of a ten-part series, you'll learn how to use a couple of methods provided by Swift Mailer to directly embed attachments into email messages. These can be very helpful when sending newsletters that contain numerous images, which you dont want to be filtered and discarded by popular web-based email systems such as Hotmail and Yahoo.
- Among the huge variety of email libraries written in PHP 5, there's one that stands out from the rest due to its well-structured programming interface, strict use of the object-oriented paradigm, and (if all of these features aren't good enough for you), its incredibly flat learning curve.
Of cours...
-
Posted: February 24th, 2010, 7:00am MST
In this eighth part of a ten-part series on the Swift Mailer email library, you'll learn how to attach files that have been dynamically generated to an email message. In addition, you'll see how to use Swift Mailer's setFileName() method to modify the name of an attachment before it's sent, which speaks for itself about this library's flexibility.
- In case you havent heard about it yet, Swift Mailer is a comprehensive library written in PHP 5 and freely available at
[swiftmailer.org.] It allows you to develop email applications very quickly and with minor effort, through a cohesive and highly intuitive programming interface.
So, if your...
-
Posted: February 23rd, 2010, 7:00am MST
Welcome to the seventh tutorial of a series on Swift Mailer. Comprised of ten parts, this series introduces you gently to using this thorough PHP5-based email package. It complements the corresponding theory with numerous code samples that you can incorporate into your own PHP applications.
- If youre a PHP developer whos looking for an approachable guide that teaches you how to take advantage of the most relevant features provided by the powerful Swift Mailer email library (available at
[swiftmailer.org),] then this group of tutorials might be the material that you really need. ...
-
Posted: February 22nd, 2010, 7:00am MST
In this sixth article of a series I discuss how to handle file attachments and sending HTML email messages with the Swift Mailer library. As you'll soon see, performing these tasks is a very straightforward process.
- If you're an experienced PHP developer, then you know that coding functions or classes that send MIME email is one of those things that you want to do only once in your lifetime. This process often requires dealing indirectly (or directly, when programming TCP sockets) with the complexities of the...
-
Posted: February 18th, 2010, 7:00am MST
This fifth part of the series expands your background in the Swift Mailer library. You will learn how to use it for sending blind carbon copies of a basic email message to a predefined recipient. The process is as simple as using its setBcc() method.
- Undoubtedly, PHP programmers often need to add some kind of email-sending capability to the programs they create, either by using a proprietary library or by way of a third-party package.
While using a custom library (or even a custom framework) may work well when the whole development process of...
-
Posted: February 17th, 2010, 7:00am MST
In this fourth part of a series, you will learn how easy it is to send carbon copies of an email message with the Swift Mailer library. The secret is the use of its setCc() method.
- If youre a PHP developer whos searching for a comprehensive guide that teaches you how to take advantage of the most important features provided by the popular Swift Mailer library, then youve come to the right place.
Welcome to the fourth part of a series that introduces you to Swift Mailer. Ma...
-
Posted: February 16th, 2010, 7:00am MST
In this third part of the series, I explain how to configure Swift Mailer to work seamlessly with the sendmail Unix program and the mail() PHP function. This process is extremely straightforward, so you shouldnt have any trouble understanding how it functions.
- Among the great variety of PHP-based email libraries available nowadays, there's one that might be particularly attractive to you. It offers a flat learning curve and impressive features, which have been implemented by using a strict object-oriented approach.
In this specific case, of course, I'm...
-
Posted: February 11th, 2010, 7:00am MST
In this second part of the series, I develop a couple of examples that demonstrate how easy it is to send email messages by using different SMTP servers, thanks to the versatility provided by the Swift Mailer PHP library.
- In case you still haven't heard about it, Swift Mailer is a powerful object-oriented PHP library written by Chris Corbin and available at
[swiftmailer.org.] It allows you to develop email applications in a truly effortless fashion by means of a set of comprehensive and well-structured classes...
-
Posted: February 10th, 2010, 7:00am MST
Do you want to build a complex email program in PHP that offers more control than the language's native mail() function? You may want to consider using the Swift Mailer email library. This multi-part series will walk you through some of its most useful features.
- If youve been developing web applications with PHP for a while, then youll surely know that the language offers a couple of options that allow you to send email messages in a pretty straightforward way. Undoubtedly, the easiest thing to do is to create email scripts by means of the mail() native ...
-
Posted: February 9th, 2010, 7:00am MST
In this conclusion to a five-part series on building a LInux wireless access point, you'll learn how to manage the details, such as DNS caches. This article is excerpted from chapter four of the Linux Networking Cookbook, written by Carla Schroder (O'Reilly; ISBN: 0596102488). Copyright © 2008 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media
- 4.15 Turning Off Antenna Diversity
Problem
Your wireless interface supports using two antennas, but youre using just one. You know that this means half of your broadcast and unicast packets are hitting a dead end, which can hurt performance. How do you send power only to one antenna?
Solution...
-
Posted: February 8th, 2010, 7:00am MST
In this fourth part of a five-part series on building a Linux wireless access point, you'll learn about firewalling, routing, and more. This article is excerpted from chapter four of the Linux Networking Cookbook, written by Carla Schroder (O'Reilly; ISBN: 0596102488). Copyright © 2008 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
- 4.11 Connecting to the Internet and Firewalling
Problem
Its high time to finish up with these LAN chores and bring the Internet to your LAN. Your wireless is encrypted, your LAN services are working, and your users want Internet. So youre ready to configure your WAN interface and build a nice s...
-
Posted: February 4th, 2010, 7:00am MST
In this third part of a five-part series on building a Linux wireless access point, you'll learn several different ways to secure your servers, so you can choose the level of security that best suits your needs. This article is excerpted from chapter four of the Linux Networking Cookbook, written by Carla Schroder (O'Reilly; ISBN: 0596102488). Copyright © 2008 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
- 4.7 Making WPA2-Personal Almost As Good As WPA-Enterprise
Problem
Youre nervous about sitting there with an unsecured wireless access point, and you really want to lock it up before you do anything else. Youve made sure that all of your wireless network interfaces support WPA2, so youre ready to...
-
Posted: February 3rd, 2010, 7:00am MST
In this second part of a five-part series on building a Linux wireless access point, you'll learn how to set up name services, set static IP addresses, and more. This article is excerpted from chapter four of the Linux Networking Cookbook, written by Carla Schroder (O'Reilly; ISBN: 0596102488). Copyright © 2008 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
- 4.3 Setting Up Name Services
Problem
Your LAN is going to have a combination of hosts with static IP addresses and DHCP clients that come and go, especially wireless clients. And, you want DHCP clients to automatically be entered into DNS so they can be accessed by hostname just like the hosts w...
-
Posted: February 2nd, 2010, 7:00am MST
Over the past few years, wireless networking has made everyone's lives easier, thanks to being able to connect to the Internet just about anywhere. If you run a Linux shop and want to go wireless, this five-part series will show you how to set up a wireless access point. It is excerpted from chapter four of the Linux Networking Cookbook, written by Carla Schroder (O'Reilly; ISBN: 0596102488. Copyright © 2008 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.
- 4.0 Introduction
Wireless networking is everywhere. Someday, well have built-in wireless receivers in our heads. Meanwhile, times are improving for Linux wireless administrators, if you shop carefully and buy wireless interface cards with good Linux support and WPA2 support. Using well-supported w...
-
Posted: February 1st, 2010, 7:00am MST
The easiest way to improve your website's conversions may have less to do with SEO and your content and more to do with how fast your pages load. Internet users have a short attention span, and won't wait for your pages to load when the next site is just a click away. Fortunately, you can fix your web page loading times with the help of Google Page Speed.
- Website loading time is one of the most important performance elements of a website. It has been said, according to a study at Peer1, that there is a loss of one third of the visitors who abandon the site after four seconds of website loading time.
Graph: % of visitors retained vs. Website lo...
-
Posted: January 28th, 2010, 7:00am MST
With bots getting intelligent enough to read easy versions of captcha, it's time to make your site a little trickier if you want to avoid spam. This article will show you how to set up a PHP web form with AJAX that uses Recaptcha, a more difficult protocol for bots to decipher.
- After a previous tutorial on PHP Ajax web forms, there were a lot of good points raised by the readers which could dramatically improve the usability and performance of any PHP AJAX web form validation.
Any good PHP web form should be able to accomplish the following important objectives:
1. ...
-
Posted: January 27th, 2010, 7:00am MST
One of the most important features in a website is the ability to show videos to your visitors. There are a lot of video hosting solutions nowadays, with YouTube as the most popular. However, due to its popularity, there are lots of services -- even free services -- that let viewers download your video files after you've uploaded them to YouTube. If you need to restrict downloading of your files, keep reading.
- If your videos are for viewing purposes only and you need to strictly restrict downloading, then this tutorial can help you. Unlike YouTube, where all your uploaded videos are viewable in a single channel (thus any infringer can easily locate and download all of them), if you use the technique discu...
-
Posted: January 26th, 2010, 7:00am MST
Welcome to the conclusion of a three-part series that shows you how to count the back links to your web site from unique domains using the Yahoo Inbound Links API. In the second part you learned how to pass the form variables to PHP using AJAX, process the web form input using PHP, and finally validate the root domain name URL using PHP. In this part, we discuss the details of the Yahoo API PHP script process.
- Formulate a Request to Yahoo Inlinks API
It is a wise programming strategy to report all errors, so the first line before communicating to the API is this one:
error_reporting(E_ALL);
To formulate the request, we need values for the following API variables, which we can obtain from us...
-
Posted: January 25th, 2010, 7:00am MST
In the first part of this three-part series, you learned the guiding concepts and design for building a PHP web application to count back links from unique domains using the Yahoo Site Explorer API. In this part, we will illustrate, in detail, how to do the programming for the PHP Ajax web form and the validation script.
- At the end of the third part, I'll give you a link which you can use to download all the files associated with this web application project.
Passing form variables to PHP via AJAX
The script uses captcha code that will pass the answer for the challenge using a PHP session, so at the top of the we...
-
Posted: January 21st, 2010, 7:00am MST
If you've just started using the Yahoo Site Explorer Inbound Links API and want to know how far you can take it, keep reading. This three-part series will show you how to build an application that can help you track your links.
- In two introductory article series on the Yahoo Site Explorer Inbound Links API, you learned the very basic steps involved in connecting to the Yahoo Inbound Links API using the PHP server side scripting language to get important link- related data.
Those were very basic concepts which you need t...
-
Posted: January 20th, 2010, 8:30am MST
Welcome to the final part of a seven part series on building polymorphs in PHP. In a friendly fashion, this series gets you started constructing polymorph classes specifically in PHP 5. It shows you how to accomplish this by using first interfaces, then parent classes, and finally a proper combination of both.
- And now that you've been introduced to the main goal of this group of tutorials, its time to review the topics discussed in the last one. In that article I explained how to build a couple of polymorph classes; both of them inherited structure from a simple interface and functionality from an abstr...
-
Posted: January 19th, 2010, 7:00am MST
In this penultimate part of a seven-part series on building polymorphs in PHP 5, I demonstrate how easy it is to build polymorph objects that merge the functionality of abstract classes and the structure of interfaces. The entire creation process is simple enough that you shouldnt have major problems grasping its underlying logic.
- As you may know, most of the mature programming languages that are used nowadays permit developers to implement Polymorphism in one form or another. Undoubtedly C, C++ and Java, for example, are languages that allow you to build polymorph structures, either at function-level or class-level. This ...
-
Posted: January 14th, 2010, 7:00am MST
In this fifth part of a seven-part series on building polymorphs in PHP 5, you will learn how to build a polymorph object by combining an abstract class and a simple interface. As you'll see, this object will be used for constructing basic HTML divs.
- Without a doubt, understanding how to build polymorph objects in PHP 5 can be of great help when developing object-oriented web applications. this is especially true if you want to make use of the big pillars of software engineering in a truly efficient way.
In addition, its quite possible that y...
-
Posted: January 13th, 2010, 7:00am MST
Welcome to the fourth installment of an article series on building polymorphs in PHP. Made up of seven tutorials, this series attempts to teach you through numerous, comprehensive code samples how to create polymorph objects. You'll see how to do it using interfaces, then abstract classes, and finally a combination of both.
- Now that you know what to expect from this set of articles, its time to summarize the topics covered in the last one. In that part of the series I started developing a basic example to demonstrate how to build a couple of polymorph classes that inherited most of their functionality from a base ...
-
Posted: January 12th, 2010, 7:00am MST
In this third part of a seven-part series, I demonstrate how to build polymorph objects using abstract classes in PHP 5. As you'll see, it's a pretty straightforward process that can be tackled with relative ease.
- Learning how to build polymorph objects in PHP 5 is one of those topics that must be tackled sooner or later by those developers who want to expand their skills in using the object-oriented paradigm for creating web applications.
So, if youre a PHP programmer looking for a friendly guide that shows...
-
Posted: January 11th, 2010, 7:00am MST
In this second article in a seven-part series on building polymorphs in PHP 5, I provide you with another example of how to do this by way of a simple interface. For this tutorial, I decided to work with objects that are responsible for rendering different HTML elements, such as div and paragraphs, but naturally its possible to construct these types of object for different purposes as well.
- One of the most powerful foundations of efficient software development is Polymorphism. This is true even though many inexperienced developers do not see how relevant this key pillar of programming actually is to building solid applications.
In PHP 5, which as you know is best for constructing...
-
Posted: January 7th, 2010, 7:00am MST
In the first part of this two-part series, you learned the network communication concepts you need to know to understand the operation and data provided by Wireshark. I also covered the installation steps and some very basic configuration. This part will delve more deeply into using Wireshark for analyzing your network.
- Specifically, in this part, you will learn details about Wireshark, its operation, features, capturing packets and getting text data, as well as interpretation of packet information. You will also learn how to optimize the configuration of Wireshark so that you can capture not only packets from you...
-
Posted: January 6th, 2010, 7:00am MST
You don't need to be working in a strictly-typed language like C to enjoy the benefits of polymorphism. You just need to achieve it at a different level. In this seven-part series, you'll learn how to use polymorphism in PHP 5.
- If you've ever developed applications with C, then you know that its support for Polymorphism is thorough, clear and well defined. Being a structured, strictly-typed language, C will let you define functions that have the same name and that also accept the same number of arguments. However, if the ...
-
Posted: January 5th, 2010, 7:00am MST
Do you need to sniff out and spy on network communications in a LAN, WAN or any network configuration? Or have you found yourself in a difficult situation troubleshooting network-related problems inside and outside of your network? Then you need a network analyzer to examine the packets going into and out of certain media. Wireshark can help. Keep reading to find out how.
- One of the most popular open source network analyzers is Wireshark. Since it is open source, you can use it for all purposes as long as you abide by their terms of use, whether for personal, commercial or education-related projects.
This article is for readers who are entirely new to Wireshark and ...
-
Posted: January 4th, 2010, 7:00am MST
In this second part of a two-part series on error and exception handling in PHP, we focus specifically on handling exceptions. This article is excerpted from chapter 8 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Exception Handling
Languages such as Java, C#, and Python have long been heralded for their efficient error-management abilities, accomplished through the use of exception handling. If you have prior experience working with exception handlers, you likely scratch your head when working with any l...
-
Posted: December 31st, 2009, 7:00am MST
Mistakes are inevitable, in life, programming, and application submissions. You can prepare for errors by making sure your application is designed to respond to them. This two-part article explains how PHP handles errors. It is excerpted from chapter 8 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
- Even if you wear an S on your chest when it comes to programming, you can be sure that errors will creep into all but the most trivial of applications. Some of these errors are programmer-induced they are the result of mistakes made during the development process. Others are user-induced, caused by ...
-
Posted: December 30th, 2009, 7:00am MST
Despite their name, static properties can help in a wide variety of situations. If you're not using them currently, and you regularly implement design patterns in your code, after reading this series you'll wonder how you ever did without them. This article is the conclusion to a four-part series.
- The term static is misleading when applied to a property of a class in PHP 5. It may lead you to think that a property like this does nothing particularly useful, or simply that its functionality is so irrelevant that it can't be considered a truly dynamic in-memory place.
Fortunately, this ini...
-
Posted: December 29th, 2009, 7:00am MST
In this third part of a four-part series on static variables, I show how to use another static property in the previous MySQL driver to connect more cleverly to the database server. This example demonstrates how powerful a property like this can be, when utilized in an effective manner.
- While at a glance the subject may seem rather irrelevant and even pretty boring, the truth is that the proper use of static variables in PHP 5 classes can be of great help in improving the way that they perform certain tasks and their relationship in a given application context.
Thus, if you're a...
-
Posted: December 28th, 2009, 7:00am MST
In this second part of a four-part series, I finish building a sample MySQL driver by adding to it a whole new class responsible for iterating over database result sets through a friendly and intuitive API. This functional example shows that the use of a simple static property makes it easier to implement the Singleton pattern, which is convenient when developing a class that abstracts the access to a database server, be it MySQL or a different one.
- Understanding the behavior of static class properties in PHP 5 is a straightforward process that can be tackled with minor headaches, even for inexperienced developers taking their first steps into the huge and sometimes esoteric field of object-oriented programming.
And the reason for this is sim...
-
Posted: December 23rd, 2009, 7:00am MST
Welcome to the final installment of a series on working with foreign key constraints in MySQL. With a respectable number of code samples, this series walks you through the basics of using foreign key constraints in MySQL tables and teaches you how to use them specifically for maintaining the integrity of relational databases.
- And now that you've been introduced to the goal of this group of articles, its time to refresh the topics that were covered in the last tutorial. In the penultimate part of the series, I showed you how to trigger the deletion in cascade of rows of a child MySQL table after performing the same oper...
-
Posted: December 22nd, 2009, 7:00am MST
In this first part of a four-part series, I show you how the declaration and further use of a single static property inside a MySQL abstraction class can be really useful for turning this class into a Singleton. While its fair to say that you can use different approaches for implementing this design pattern, most of them will employ a static variable.
- Without starting a debate about the strengths and weaknesses of PHP 5, I'd like to say that the language, with all its cons and pros, has reached a great level of maturity, particularly when it comes to evaluating its highly-enhanced object model.
Well-known improvements like member visibility a...
-
Posted: December 21st, 2009, 7:00am MST
In this fifth article of a six-part series, you will learn how to use foreign key constraints in MySQL to produce the deletion in cascade of rows in a child table when the related rows of the corresponding parent are deleted as well. We'll use a simple MySQL abstraction class to do the trick.
- Maintaining the integrity of a database in MySQL or other RDBMS isnt always a simple task; this is notoriously evident where the responsibility to carry out this process is delegated to the application that interacts with the database. In those situations, establishing and maintaining relationships...
-
Posted: December 17th, 2009, 7:00am MST
In this fourth installment of a six-part series, I explain how to use foreign key constraints to update rows of two InnoDB tables via a basic abstraction class built into PHP 5. This example will help you start utilizing foreign key constraints with a particular server-side scripting language.
- Being the most popular open source RDBMS available nowadays, its not breaking news to say that MySQL supports multiple storage engines, including the default, highly-fast MyISAM type, which you may have used hundreds of times before for developing your own database-driven web applications.
However,...
-
Posted: December 16th, 2009, 7:00am MST
In this third installment of a six-part series, I explain how to trigger cascading updates and deletions of records of a child table, when performing the same operations on the associated rows of its parent table. Achieving this with InnoDB tables is a simple process, thanks to the use of a single foreign key constraint.
- True to form, developing database-driven applications that can maintain the integrity of multiple tables isnt an easy task. This applies to programs that interact with the most popular open source RDBMS available today, MySQL server.
Understanding why building such applications can be a pretty di...
-
Posted: December 15th, 2009, 7:00am MST
Welcome to the final part of a series on implementing factory methods in PHP 5. Composed of six approachable tutorials, this series uses numerous hands-on examples to teach you how to define specific methods within your own PHP programs. These methods return to client code instances from their originating classes, and from other classes as well.
- And now that you know what to expect from this series of articles, its time to quickly review the topics that were covered in the last tutorial. In that part of the series I built a simple application in PHP 5 composed of two classes for its building blocks. The first was merely a basic MySQL ab...
-
Posted: December 14th, 2009, 7:00am MST
Welcome to the fifth part of a six-part series on implementing factory methods in PHP 5. In this part, I show how the removal of a factory method inside the constructor of the class that originates persistent objects can produce a huge impact in the way that those objects handle its dependency, which happens to be a database handler object.
- Unquestionably, defining factory methods during the development of an application is a task that both programmers and web developers must tackle frequently. In the case of PHP 5, this process is fortunately a no-brainer one, due to the versatility of its robust object model and its flat learning...
-
Posted: December 10th, 2009, 7:00am MST
Foreign key constraints are a powerful feature provided by many modern RDBMS that allow you to automatically trigger specified actions, such as deletions or updates of the records of database tables that maintain a predefined relationship with each other. This is the second part of a six-part article series that shows you how to work with foreign key constraints in MySQL.
- The good news is that you, as a PHP developer, can take advantage of the numerous advantages offered by foreign key constraints when working with InnoDB tables in MySQL (even though support for MyISAM tables has already been announced for future releases of MySQL).
So, if youre interested in learn...
-
Posted: December 9th, 2009, 7:00am MST
In this first part of a six-part series, I provide you with a basic introduction to using foreign key constraints with InnoDB tables in MySQL. As you'll soon see, triggering a cascading update on the records of a child table when updating the rows in a parent table is a breeze.
- If you have ever developed some small database-driven web applications with MySQL, then certainly youll know that performing CRUD operations (short for Create, Retrieve, Update, Delete) on a few relational database tables is a pretty straightforward process. In theory, a decent knowledge of the mos...
-
Posted: December 8th, 2009, 7:00am MST
In this fourth part of a six-part series on implementing factory methods in PHP 5, I show how a simple factory method can improve the efficiency of a sample database-driven application when a database handler is utilized by multiple objects. In this specific case, the method returns Singletons of the database handler, which is a significant enhancement.
- As their name clearly suggests, factory methods are regular class methods whose responsibility is to fabricate objects in accordance with the requirements of a specific context. Since these methods are a concrete implementation of the homonymous design pattern, theyre used frequently in mature obje...
-
Posted: December 7th, 2009, 7:00am MST
Welcome to the third part of a series that shows you how to implement factory methods in PHP 5. Made up of six tutorials, this series uses numerous friendly code samples to illustrate how to implement the Factory and Singleton design patterns within your PHP 5-based web applications. In this way, they will be able to build objects in a truly efficient manner.
- And now that you know what to expect from this set of articles, its time to review the topics that were discussed in the last one. In that installment of the series, I explained how to build a simple factory class that could return to client code objects that represented a couple of common web f...
-
Posted: December 4th, 2009, 2:00pm MST
As the Internet integrates itself more and more into our daily lives, we see the popularity of electronic media spread like a virus. Websites like Youtube and Flickr have had a great deal of success by primarily focusing on user-generated content. Because so many people are uploading media, making the process as easy as possible makes the most sense. Keeping reading to see how Flex can do this for you.
-
All modern browsers have some default methods of uploading which can be expanded to some degree. But to make a really sleek application which can provide cool features like upload progress, image preview, and multiple file upload...
-
Posted: December 3rd, 2009, 7:00am MST
Definitely, building chainable class methods with PHP 5 is a process that can be mastered with minor effort, even for developers with only an average level of experience in using the object-oriented paradigm. Therefore, if you're a passionate PHP programmer who wishes to learn the key concepts that surround the implementation of method chaining in a painless fashion, then this group of articles is what you need.
- Welcome to the final part of a series that covers method chaining in PHP 5. In twelve tutorials, this series attempts to teach you the basics of building chainable class methods with PHP 5 and complements the corresponding theory with copious hands-on examples.
And now that you've come to this po...
-
Posted: December 2nd, 2009, 7:00am MST
In this eleventh part of a 12-part series on method chaining, I will finish building the custom CodeIgniter library we've been working on by adding to it some very useful features. When we're done, the library will be able to autoload a specified model and validate input data.
- True to form, method chaining is a powerful approach that lets programmers build compact and highly modular class interfaces. Of course, this methodology isnt a proprietary feature of a particular language, which means that it can be applied quite easily in PHP 5.
Thus, if youre a PHP developer who...
-
Posted: December 1st, 2009, 7:00am MST
In this second installment of a six-part series on implementing the factory pattern in PHP 5, I explain how to build an improved version of a factory class that returns Singletons of itself to client code.
- While this may sound like a cliché, the truth is that building factory methods in PHP 5 is a straightforward process that only requires an intermediate background in working with objects and classes. After all, a factory method is merely a regular class method that returns, when possible, one or mor...
-
Posted: November 30th, 2009, 7:00am MST
When two people are able to communicate we generally assume that they know the same language, and that is the key to understanding each other. This applies to the world of computing as well, where the set of standards are called protocols. During this article we plan to present in a nutshell the most common TCP/IP protocol types. We wont get in-depth, so dont expect university course-style material just the basics.
- Before we move on, let's fully grasp the concept of protocol and explain how more of those build up a structure called the OSI model. How are they important to us? Finally, we'll get into enumerating the popular TCP/IP protocols. These are the ones we need to be familiar with, since our applications...
-
Posted: November 25th, 2009, 7:00am MST
Welcome to the tenth installment of a series on method chaining in PHP 5. Comprised of twelve tutorials, this series teaches you the key concepts that surround the implementation of chainable methods within PHP classes, and shows how to put them to work to create a custom library for the popular CodeIgniter framework.
- And now that you know what to expect from this series of articles, its time to refresh the topics that were discussed in the last one. In that part of the series I explained how to add some chainable methods to the already familiar AbstractModel class, which was a pretty useful add-on for CodeI...
-
Posted: November 24th, 2009, 9:56am MST
You might scoff at the idea of using PostgreSQL to replace your Oracle database, but when you look inside the numbers you can save a lot of money. Migrating from Oracle to PostgreSQL might make sense for you.
- PostgreSQL is known for its transactional power and for years has been treated as an afterthought when considering enterprise database development. However, a company called EnterpriseDB is attempting to expound on the joys of using PostgreSQL.
EnterpriseDB is the leader in developing open-source...
-
Posted: November 24th, 2009, 7:00am MST
If youve ever developed desktop applications using mature object-oriented languages like C++ and Java, then its possible that youve found yourself saying a few funny phrases such as I need to implement a factory method within this class, or in the worst case: this class needs to implement a factory method, but I dont have a single clue about how to do that. Surprisingly, you can implement these factory methods pretty quickly and easily in PHP 5, as this six-part series will show you.
- To be honest, I grappled with factory methods in Java myself, but in the end I learned not only how to quickly build factory methods in Java classes, but how to implement those methods in PHP as well.
While it's undeniable that PHP is easier to learn than Java, many PHP developers with long e...
-
Posted: November 23rd, 2009, 7:00am MST
This is the second part of a tutorial on file splitting during an FTP upload. In this part, you will learn the details of file merging and implementation. The split PHP script was thoroughly discussed in the first part. It is highly recommended that you read that part to easily understand this one.
- As discussed before, once all the split parts of the file have been uploaded to the FTP server, you can safely recombine them into one file again (this is the merging process) using the PHP file merging script.
Example: File splitting process
Before we start the merging process, lets look at an a...
-
Posted: November 19th, 2009, 7:00am MST
In the first part of this two-part series, you learned the importance and principles of Yahoo Site Explorer's inbound links API with respect to search engine optimization. If you read that part, you should already have your application ID, which will be used in your PHP script to make API calls. Also discussed in the first part is how to formulate the GET Request URL, and how to understand the responses from the inbound links API. In this part, you will start consolidating all of those inputs and implement what you've learned using a PHP server side scripting language.
- The Basic Request and Response PHP Script
Yahoo Site Explorer's inbound links API provides sample PHP code to make requests and for receiving responses. The API documentation for using PHP in the application can be found in two places, here and here. The sample script at the second link is a very ...
-
Posted: November 18th, 2009, 7:00am MST
In this ninth part of an 11-part series on method chaining, I will add three new chainable methods to the custom CodeIgniter model class we built in previous parts. You should find this a straightforward process, especially if you have a decent background in this frameworks database class.
- While its not going to change forever the way that PHP developers build their web applications, method chaining is a solid programming approach that permits them to build classes that have highly compact and modular interfaces.
So, if youre always looking for new ways to improve your existing deve...
-
Posted: November 17th, 2009, 7:00am MST
One of the known limitations of free hosting packages is the file upload limit. For example, some hosting companies set an upload limit of 500 KB. This means that for any uploads to the FTP server, the file should not be more than 500 KB or else the server wont accept it and you will not be able to upload your file. Fortunately, by splitting your files, you can get around this limitation; this two-part tutorial series will show you how.
- Of course, some files that are important for web site functionality exceed 500 KB. For example, if you are running a web application that needs a geo IP database, a typical file for the geo IP DAT file is around 1.1MB. So this cannot be uploaded as one batch because it exceeds the upload limit of ...
-
Posted: November 16th, 2009, 7:00am MST
Welcome to the eighth installment of a series on method chaining in PHP 5. With numerous code samples, this series shows you how to define chainable methods within your own PHP classes. Best of all, it teaches you how to implement this powerful programming method in a real-world case: developing an abstract model for the CodeIgniter framework.
- Naturally, if you already read the preceding article of the series, at this point you have a clearer idea of how to apply the method chaining approach to building a customized model class for CodeIgniter. In that tutorial I started to create such a class. It had the ability to fetch and insert/upd...
-
Posted: November 12th, 2009, 7:00am MST
The Yahoo Site Explorer API offers useful data for anyone who is trying to do well in the search engines. The trick is getting that data into a form you can use. Keep reading to learn how to build an application that will organize the information so you can analyze it.
- If you belong to the search engine marketing industry, one of the most important decision making problems can be found in search engine optimization (SEO). You will need to do analysis of both your competitor's and your own web sites. In SEO aimed at Google, one of the most important factors to e...
-
Posted: November 11th, 2009, 7:00am MST
Welcome to the seventh part of a 12-part series on the technique of method chaining in PHP 5. In this part, I will demonstrate how method chaining can be used to develop some core methods of a custom library for CodeIgniter.
- In case you havent explored it in depth yet, method chaining is a useful programming methodology that permits you to build highly modular and compact APIs when using the object-oriented paradigm. This isnt a proprietary feature of a specific programming language; however, its possible to implement...
-
Posted: November 10th, 2009, 7:00am MST
This article shows illustrative examples of how PHP and some advanced MySQL queries can be used to build an online trading system. For simplicity, we will be featuring one of the most common stock indexes: the S P 500 index.
- This is also called E-mini S amp;P 500 futures, one of the most commonly traded equities/futures.
The Design
As of September 2009, there was no currently working trading system on the Internet powered by PHP and MySQL despite the platform's popularity among open source communities.
A trading sys...
-
Posted: November 9th, 2009, 7:00am MST
Among the numerous features provided by PHP 5, theres one that many developers find appealing. It permits the building of compact and modular programming interfaces. Yes, as you may have guessed, in this specific case Im talking about method chaining, a programming approach can be easily mastered by those with an average background in the object-oriented paradigm. This is the sixth part of a 12-part series on method chaining.
- Indeed, learning how to create chainable methods in PHP 5 class is a pretty straightforward process that will make your own classes more compact and modular as well. Therefore, I suggest you read this series of articles; in it, you'll find an approachable guide that will show you the basics of usin...
-
Posted: November 5th, 2009, 7:00am MST
If you are a web developer or administrator, aside from administering your web server, you should also be administering your MySQL database in terms of security. This database is open source and is commonly used with the PHP web server scripting language; tons of useful applications are being developed with this kind of setup. This is good, but it opens up issues, which we'll discuss here along with their solutions.
- Because of its immense popularity, MySQL is also a regular target for malicious users or hackers wanting to exploit your system and steal data. This type of exploit can be serious; it can include putting malicious software on your web server and using the website to host malware.
To avoid lettin...
-
Posted: November 4th, 2009, 7:00am MST
Welcome to the fifth part of a 12-part series focused on method chaining in PHP 5. Through a set of comprehensive and easy-to-follow tutorials, this series of articles shows you how to create and use chainable methods within your own classes. It also teaches you how to implement this useful programming methodology for developing real-world web applications.
- And now that you have been gently introduced to the main goal of this multi-part series, its time to quickly summarize the topics that were discussed in the last installment.
In that article I explained how to create a simple, yet useful MySQL abstraction class. It was composed of a few straightf...
-
Posted: November 3rd, 2009, 7:00am MST
PHP encryption is a method of obfuscating scripts in such a way that it offers additional protection and prevents unauthorized editing of the scripts. This article discusses both encryption and decryption.
- You might have seen encrypted PHP scripts which may look like the one below:
lt;?php eval(gzinflate(base64_decode('FZfHDoTYEUV/ZXYzIxbkJFseAU1qcg4bi9TknPl64z0SUK/
evef8859///NHcSTdX+VTD78u2Yq/0mQtCOy/
eZGNefHXn0L8kz5jKAueDcZhVNSnh9+OYd6flsK+PCKjqtEnIJoRtF3TO+
GH4UyCIED/st8VD9APjg8Nj+m1ysH0OIj...
-
Posted: November 2nd, 2009, 7:00am MST
In this fourth part of a 12-part series on method chaining, I start building a basic MySQL abstraction class that implements a few straightforward methods. Of course, the methods can be easily chained to each other, which permits us to build different parts of a SELECT statement through a truly compact and readable API.
- Put it in a simple way, method chaining is a handy programming methodology that allows you to create classes whose methods can be easily linked to each other, thus building a highly compact API.
Building chainable methods is not a proprietary approach supported by a particular programming language...
-
Posted: October 29th, 2009, 7:00am MDT
If you're looking for a way to control or restrict access to your Linux-based applications, you might want to look at SELinux. This extension has been around since Linux kernel 2.6 and can help you with your access issues.
- Before we begin, first we need to understand what kind of access control we're talking about, and then we can easily comprehend how quot;mandatory access control quot; (MAC) tries to accomplish our aims. The operating system has the ability to examine the course of an action that an quot;initiator...
-
Posted: October 28th, 2009, 7:00am MDT
In this third part of a 12-part series on method chaining, I complete the definition of the sample string processor class. This process will help reaffirm the concepts that you learned before regarding the definition and implementation of chainable methods in PHP 5.
- Method chaining is a simple, yet powerful, programming approach that permits you to write classes whose methods can be easily linked with each other, thus building a modular and highly-compact API. Logically, as with other methodologies, chainable methods are not a proprietary feature of a particula...
-
Posted: October 27th, 2009, 7:00am MDT
Do you want to learn how to handle PHP WHILE loops? WHILE loops are one of the most powerful features as well as the easiest loop available to any PHP/MySQL developer. They enable us to shorten repetitive tasks for a highly useful application. This tutorial gives examples of WHILE loops in PHP/MySQL that beginner and novice developers can use as a quick reference for building similar loops in their applications.
- The early part of this article will focus on both basic and advanced WHILE looping techniques entirely written for PHP. The last part will be devoted to the use of WHILE Loop in displaying MySQL queries.
There are different types of loops in PHP that suit different applications. Seeing actual ex...
-
Posted: October 26th, 2009, 7:00am MDT
In this second part of a 12-part series on method chaining, I explain how to extend the functionality of the string processor class by adding to it a few simple chainable methods. I conclude this part by defining a factory method within the string processor class.
- Method chaining is a programming approach that permits you to chain multiple methods of a class in one single step, to perform several tasks in the context of a specified application.
Logically, this approach can be used equally with various programming languages, and PHP 5 certainly is no exceptio...
-
Posted: October 22nd, 2009, 7:00am MDT
Many sites feature web forms to collect information from users. Unfortunately, these forms often provide a poor experience for the user, with predictable results. This article will show you how to make filling out web forms more fun (or at least less painful) for your users with the help of PHP and some AJAX magic.
- One of the most important requirements for PHP web forms is usability; it's the goal of many web designers to improve the user's experience. With classic PHP web forms, a user is required to enter information in the form and then press the submit button. The PHP script will then validate the data ...
-
Posted: October 21st, 2009, 7:00am MDT
Method chaining is a useful technique that helps you to write more compact and powerful code. In this first part of a series that introduces you to this programming methodology, you'll learn how to define and use chainable methods in PHP 5. The process is quite simple to grasp, even if you have only an intermediate background in using the object-oriented paradigm.
- Over the course of the last few years PHP has reinvented itself; that's why it's the mature language that we see nowadays. The most significant change introduced by the PHP development team is the release of PHP 5, which incorporates a robust object model, a good exception handling mechanism, type...
-
Posted: October 20th, 2009, 7:00am MDT
Welcome to the sixth part of a series covering the dependency injection pattern. In this part, I build a PHP 5-based application that can work seamlessly with MySQL and SQLite. It will feature a simple interface and a MySQL driver.
- When it comes to defining the way that a PHP class is going to accept the instances that it will need to work within a given application, theres a simple and powerful approach that allows you to achieve this goal in a truly effective way, without suffering premature hair loss.
Does this phrase rin...
-
Posted: October 19th, 2009, 7:00am MDT
In this fifth part of a six-part series on the dependency injection pattern, I explore the implementation of the pattern by using a simple setter method within a model class. You'll see that this approach is very easy to follow.
- While not as widely known as other popular design patterns like Singleton and Factory, the dependency injection pattern is a powerful programming methodology that allows you to define the way that one given class is going to accept additional objects that it requires to work as expected.
In the...
-
Posted: October 15th, 2009, 7:00am MDT
Welcome to the fourth part of a series on applying the dependency injection design pattern in PHP 5. Through a strong hands-on approach, this series teaches you several methodologies that you can use for taking advantage of the functionality given by this simple yet powerful design pattern. It shows you how to build classes that follow the schema imposed by the Inversion of Control software design principle.
- And now that you've been introduced to the goal of this series, its time to review the topics that were covered in the last article. In that tutorial I explained how to apply the dependency injection pattern with a couple of sample classes.
In this concrete example, the first of these classes was ...
-
Posted: October 14th, 2009, 7:00am MDT
In this third article of a six-part series, you will learn how to implement the dependency injection pattern by using a simple setter method. This process is very similar to the one that uses a constructor, which we covered in the previous article.
- One of the most common tasks that many PHP 5 programmers must tackle during the development of object-oriented web applications is defining the way that objects are going to interact with each other. While this process seems to be a no-brainer one at first sight, the truth is that in real-world cond...
-
Posted: October 13th, 2009, 7:00am MDT
While not being as widely known as other design patterns such as Factory, Singleton or Active Record, the Dependency Injection pattern provides both programmers and web developers with a well-structured solution that allows them to solve issues that arise when an object needs the functionality of another one (hence the dependency) to work as expected. This is the second part of a six-part series that shows you how to apply this pattern.
- In simple terms, when this pattern is applied, the dependency is directly injected (hence its name), either through the constructor of the receiver object or via a setter method. In both cases, the implementation of the pattern goes hand in hand with a concept of software engineering called Inversi...
-
Posted: October 8th, 2009, 7:00am MDT
In this first part of a six-part series, I introduce you to the dependency injection design pattern and its use with MySQL. Specifically, I create a typical scenario where one persistent class needs the functionality of its dependency, in this case a database handler, to gain access to a MySQL table.
- Without a doubt, design patterns are one of the big pillars of software development that allow you to build high-quality desktop and web applications through well-trusted solutions. A solid understanding of basic concepts such as inheritance and polymorphism, in conjunction with a respectable knowl...
-
Posted: October 7th, 2009, 7:00am MDT
Statistics aren't just for Excel spreadsheets anymore. If you've been wondering how to use PHP to help you do a basic statistical analysis, keep reading. In this article you'll learn how to use PHP to help you compare data sets.
- This is the continuation of a two-part article in which we cover the use of PHP to calculate descriptive statistics. In this article, we will go deeper, using PHP to do inferential statistics. This is a completely different area of statistics in the sense that inferential statistics deals with the ...
-
Posted: October 6th, 2009, 7:00am MDT
Have you ever thought of doing statistical analysis using PHP? Well, as simple as this technology can be, it enables an analyst to do server-side scripting commands which accept data from a web form, and then analyze the data in the server using PHP.
- What is the benefit of doing it on the server side? First and foremost, it offers security to the scripts and to your tool. Most statistical analysis tools online are handled with JavaScript, which is client-side and prone to data alteration, as in the case of JavaScript injection.
If the scripts ...
-
Posted: October 5th, 2009, 7:00am MDT
In the first part, you learned about CSS and some basic tips/techniques for using the slider to display colors. In this part, we will discuss how we are going to write our AJAX and PHP scripts to make our user-defined CSS website.
- If you'd like to see where we're headed before we get there, you can check out the complete demo.
You can use this CSS/AJAX technique to let users customize your website's font colors and backgrounds to maximize their user experience. It was said in the first part that if users have the freedom t...
-
Posted: October 1st, 2009, 7:00am MDT
PHP as a server side scripting language can be used to customize CSS. This can make your website more readable and useful to your visitors. In this article, you'll learn what you can do to let them adjust your site so it looks good to them. This is the first part of a two-part series.
- Consider this example: you are designing a website with a black font color and white background. It seems very nice on your monitor; the problem is your readers. Some computer monitors may display your web page as extremely sharp because of the white background. Depending on the situation, some read...
-
Posted: September 30th, 2009, 7:00am MDT
If youre a PHP developer who wants to learn how to create objects that can maintain their state through different HTTP requests, either by using cookies, plain text files or MySQL database tables, then dont look any further because youve come to the right place. Welcome to the last part of a six-part series on building persistent objects in PHP 5. This tutorial series introduces the key concepts that surround the creation of persistent objects, and complements the corresponding theory with copious code samples.
- And now that you know what to expect from this set of articles, it's time to review the topics that were discussed in the last one. In that part of the series I built a simple example class in PHP 5, which was able to save its properties, along with the values assigned to them, to a MySQL table....
-
Posted: September 29th, 2009, 7:00am MDT
Welcome to the fifth part of a six-part series that shows you how to build persistent objects in PHP 5. In this part of the series, I'll show you how to develop a persistent class that can save its properties to a MySQL table.
- Frankly speaking, creating objects in PHP 5 that are capable of maintaining their state through several HTTP requests is a pretty simple task, certainly much easier than you might have thought. In general terms, the entire creation process is reduced to defining a class that has some kind of storag...
-
Posted: September 28th, 2009, 7:00am MDT
Persistent objects appear at first to be an obscure and hard-to-grasp subject that belongs under software development. In fact, persistent objects are simply regular objects spawned from a class that has some form of storage mechanism associated with it. This six-part series shows you how to get the most out of persistent objects in your web applications.
- In the particular case of PHP 5, which as you know is well-suited for building web applications, persistent objects are very often created to overcome the stateless nature of the HTTP protocol. This implies defining classes that are capable of saving the state of their instances to a database tabl...
-
Posted: September 24th, 2009, 7:00am MDT
Welcome to the conclusion of a five part series that shows you how to implement lazy and eager loading in PHP 5. These two design patterns allow you to handle the resources for an application in very different ways. Through numerous code examples, I've demonstrated when it is appropriate to use each method.
- As you may know as a PHP programmer, one of the most important facets that must be tackled during the development of a web application is properly establishing the way that its resources will be managed. While there are many factors involved in this process that will affect, both directly and ind...
-
Posted: September 23rd, 2009, 7:00am MDT
Welcome to the fourth chapter of this series on implementing lazy and eager loading in PHP 5. In five friendly tutorials, this series walks you through the basics of using these powerful approaches for including classes on request in your scripts, and teaches you how to work with these patterns when manipulating properties of a certain class.
- Without a doubt, grasping the key concepts that surround the implementation of the lazy and eager loading design patterns in PHP 5 can be of great help when it comes to developing web-based applications that handle their resources in a truly efficient way.
So, if youre a PHP programmer who wants to...
-
Posted: September 22nd, 2009, 7:00am MDT
Welcome to the third part of a six-part series on building persistent objects in PHP 5. Through a decent variety of code samples, this series provides you with the right pointers to start creating objects that can save themselves to a persistent storage mechanism, including simple cookies, plain text files, and MySQL database tables.
- Though it may sound scary and a bit intimidating, creating objects in PHP 5 that can maintain their state through a number of HTTP requests is an extremely simple process. It only requires an intermediate background in the object-oriented paradigm, along with a basic understanding of how to serial...
-
Posted: September 21st, 2009, 7:00am MDT
Despite its rather intimidating name, persistent objects represent a pretty simple concept applied very often in software development. It's aimed at creating structured entities that can maintain their status across different stages of an application. This six-part series will take the mystery out of persistent objects so you can use them in your own applications.
- When using PHP 5 for developing web-based programs, creating this kind of object is even simpler. In most cases, the creation process is reduced to defining classes that are simply capable of keeping their state through several HTTP requests, in order to overcome the stateless nature of this protoc...
-
Posted: September 17th, 2009, 7:00am MDT
Welcome to the third part of a five-part series on lazy and eager loading in PHP 5. In this part of the series, you'll learn about the lazy design pattern, and how to use it effectively in your applications.
- Very often, the terms lazy and eager are used in daily talking to define or qualify the way that certain people are, or simply to judge their behaviors and reactions in response to a number of situations that occur in life. The truth is that we, as individuals, are an interesting mixture of thes...
-
Posted: September 16th, 2009, 7:00am MDT
Welcome to the second installment of a series that shows you how to implement lazy and eager loading in PHP 5. Through a strong hands-on approach, this series teaches you how to use these patterns in some typical scenarios. In this way, you'll grasp their underlying logic and learn quickly how to take advantage of their functionality to speed up your own PHP-based programs.
- Learning how to apply the lazy and eager loading design patterns in PHP 5 can have a huge impact in the performance of your web-based applications, especially if they rely on objects that are used for interacting with one or multiple database tables. Therefore, if you're interested in learning the k...
-
Posted: September 15th, 2009, 7:00am MDT
The HTTP protocol is stateless, but sometimes it is necessary to make web applications store or remember information. This is sometimes referred to as persistent storage, and it takes on a number of different forms. This six-part series of articles will explain the concept and show you various ways to give your web applications a memory.
- Very often, youll hear web developers to say (sometimes with a subtle sense of arrogance) that a certain application uses a persistent storage mechanism to save the data it needs to work properly. This is nothing but an elegant way to say that a web program uses a relational database, a simple text...
-
Posted: September 14th, 2009, 7:00am MDT
In the last article, I talked about the need to work at the bit level in Perl and in other languages. In order to understand bits, we first took a look at how binary numbers are represented in Perl, and then we took a look at two bitwise operators, AND and OR. In looking at the operators, we looked at their most common uses in programming. We also began to look at an algorithm for finding prime numbers, but we stopped upon seeing that there is no easy implementation, at least not without a knowledge of bits.
- In this article, we'll finish learning about bits. We'll take a look at a few more operators and an important Perl function for working with bits. Finally, we'll implement the algorithm we looked at.
You may want to read the previous article if you haven't (or review it if you have) before you d...
-
Posted: September 10th, 2009, 7:00am MDT
As you may know, design patterns are proven, well-trusted solutions that tackle a specific problem that occurs frequently in software development. As with many other principles and paradigms in this area, some patterns are more popular and easier to learn than others, and when applied properly, can considerably improve the efficiency and performance of an application. This five-part article series will discuss two of these.
- In the case of PHP 5, which is better suited for developing web-based programs, there are two complementary design patterns that can be of great help in building faster and more reliable applications. Of course, as this articles title suggests, Im talking about the lazy and eager loading patterns....
-
Posted: September 9th, 2009, 7:00am MDT
Welcome to the final episode of a series that shows you how to use filters in PHP 5. Made up of nine parts, these articles show you how to utilize the numerous checking filters that come with the filter library. You can use them to thoroughly validate the incoming data handled by your PHP programs, without having to spend a long time coding custom functions or class methods.
- Naturally, if youve been a patient reader and already went through the preceding articles of the series, Im certain that at this point youll have a solid background in using the filter extension for checking common data types, including email and IP addresses, integers and float numbers, and so fo...
-
Posted: September 8th, 2009, 7:00am MDT
Welcome to the conclusion of an eight-part series on building helpers in PHP 5. It's been a long journey, modifying our helper class to make it do what we want it to. Finally, in this last part, we'll put the finishing touches on our validation class so that it functions properly, without the need to spawn helper objects.
- For many PHP developers taking the first steps in the fascinating terrain of object-based programming, building helper classes is a mysterious process. That's easy to understand, considering the thin line of differentiation that sometimes exists between helpers and full-featured libraries.
...
-
Posted: September 3rd, 2009, 7:00am MDT
It's not unusual to need to write an application that can filter and sort a list of items based on user input. Maybe your e-commerce shop offers a variety of notebooks from different companies, and you want visitors to be able to sort or filter your selection. Combining Flex with ActionScript allows you to create such an application with a minimum amount of hassle (and code), as you'll see in this article.
- If you're already familiar with Flex and ActionScript, you will know how useful the listBase controls are to fast RIA development. When working with the List, Tree, DataGrids and other controls, you may first be looking to get over the hump of populating your control with the correct data. Under...
-
Posted: September 2nd, 2009, 1:00pm MDT
Before we can discuss how to make the most of BlackBerrys rich media capabilities, its important to have a firm understanding of what rich media is and how its characterized. We'll start with an explanation of what it is exactly, and then go on to cover what you can do with the Plasmic Content Developer's Kit.
- The term rich media is used to describe a wide array of digital interactive media, which can be downloaded or embedded into a web page. If the content can be downloaded, it can also be utilized offline with various media players, such as Microsoft Media Player, Real Networks' RealPlayer, and Apple...
-
Posted: September 2nd, 2009, 7:00am MDT
Welcome to the eighth part of a nine-part series on using filters in PHP 5. In this part, I discuss how to use the filter extension for sanitizing strings in all sorts of clever manners. I'll show you how to encode quotes, low and high ASCII characters in literals, and remove them in the same easy manner. Doing this can help prevent SQL injections and XSS attacks when developing PHP applications.
- In case you havent heard about it yet, the filter extension that comes included with PHP 5 is a powerful library that allows you to perform all sorts of clever validation tasks on incoming data, ranging from checking integers and float numbers, Boolean and string values, to accomplishing more compl...
-
Posted: September 1st, 2009, 7:00am MDT
Welcome to fifth and final part of this series on creating a dynamic Twitter signature image in PHP. In the last segment, I showed you how to implement custom PHP exceptions as an error-handling mechanism in your signature image application. Today were going to wrap up our signature image application by adding a caching feature. This is a two-fold solution that both boosts performance and overcomes a pitfall in the Twitter API.
- As a result of heavy usage, Twitter has begun limiting the number of API requests that it will serve to a single IP address within a given amount of time. This limitation is generally around 50 requests per hour. While this is usually not a problem, if you begin using your signature image on hig...
-
Posted: August 31st, 2009, 7:00am MDT
If youre an enthusiastic PHP developer interested in learning how to build helper classes, you've come to the right place. This article series will teach you in a few simple steps how to build several kinds of helper classes for manipulating strings, generating dynamic URLs and validate incoming data, and so forth.
- Welcome to the penultimate tutorial of the series on building helpers in PHP 5. Comprised of eight articles, this series provides you with the basic pointers to start creating your own helper classes with minor hassles, and complements the corresponding theory with a great variety of hands-on exam...
-
Posted: August 27th, 2009, 7:00am MDT
Welcome to part four of a five-part series on creating a dynamic Twitter signature image in PHP. In the last segment, I showed you how to implement PHP 5 exceptions as an error-handling mechanism in your signature image application. Today were going to expand upon that concept by creating a custom exception class for handling error states in our application.
- The code you have for this application so far is fully functional and includes full error-handling. You may be wondering what the need is for a custom exception class in the first place. So Id like to take a moment to discuss why Ive chosen to create one.
This application serves a single purpos...
-
Posted: August 26th, 2009, 7:00am MDT
If youre a PHP developer who wishes to learn how to take advantage of the solid functionality provided by the filter extension that comes with PHP 5, then look no further, because youve come to the right place. Welcome to the seventh part of a nine-part series that gets you started using the most useful validation filters included with this PHP library.
- And now that you know what to expect from this group of articles, it's time to review the concepts discussed in the last installment. In that article I explained how to use the filter extension for validating URLs in a truly painless fashion.
Indeed, the combination of the filter_var() functi...
-
Posted: August 25th, 2009, 7:00am MDT
Over the course of my past two articles Ive been showing you how to build a script capable of creating and displaying a dynamic signature image containing the latest status from a users Twitter feed. In the third installment in this series, I will be demonstrating how to add proper object-oriented error handling to the SignatureImage class.
- Before we begin, lets take a moment to examine the fully operational class.
class SignatureImage
{
private $screen_name;
private $profile_image;
private $status_text;
private $local_avatar;
public function __construct($name, $bg_image, $adir)
...
-
Posted: August 24th, 2009, 7:00am MDT
In this sixth part of an eight-part series on helper classes, I finish developing the validation helper class created in the previous part. We'll add even more useful validation methods to expand its functionality.
- Quite often, helper classes are overlooked by developers taking their first steps in PHP-based web development. They are used to encapsulate all of the functionality required to perform certain tasks in full-featured, large-scale libraries, which sometimes contributes to breaking down the intrinsic ...
-
Posted: August 20th, 2009, 7:00am MDT
If you have ever been in an unfamiliar place or stuck in traffic and looking for an alternate route, then you already know the magic that is GPS. One of the hottest areas in smartphone development today is location-based services, and BlackBerry is on the cutting edge when it comes to providing those services. In this article we will discuss BlackBerrys support of JSR 179, and learn to incorporate GPS functionality into our applications.
- Before we delve in any further into this article, I am going to assume that you are already familiar with programming basic BlackBerry applications, and that you have the required development environments and simulators installed on your computer. If not, I suggest taking a peek at BlackBerry's Deve...
-
Posted: August 19th, 2009, 7:00am MDT
When it comes to checking incoming data in web applications, PHP 5 provides developers with a huge arsenal of functions that permit them to perform this process in a pretty straightforward way. Indeed, checking integers and float numbers, IP and email addresses, alphabetic strings and so forth is a process that must be tackled frequently by programmers. Fortunately, validating data types is not a huge production with PHP.
- PHP 5 comes bundled with a useful set of native filters that allow you to validate all sorts of data types without having to spend a long time coding custom functions. These filters are known popularly as the filter extension and offer a flat learning curve. Therefore, if youre interested in learnin...
-
Posted: August 18th, 2009, 7:00am MDT
As a BlackBerry developer, it makes sense that a majority -- if not all -- of the apps you create are business applications. That's not likely to change in the near future. Fortunately, though, there are some great tools available to make your job easier.
- Historically, BlackBerry devices have been marketed as business tools geared toward working professionals. Though some minor things have changed, such as the appearance of BlackBerry's App World , which features a wide array of games for BlackBerry devices, it seems impossible to deny the fact that ...
-
Posted: August 17th, 2009, 7:00am MDT
Helper classes seem easy to build -- almost deceptively so. If you're building a helper class to assist with a crucial function, however, such as validation, the approach you need to take may seem a bit less straightforward. This fifth article in an eight-part series on building helper classes walks you through the process, complete with hands-on examples.
- True to form, for any PHP developer with only an average background in the object-oriented paradigm, building helper classes should be a pretty straightforward task. After all, this process doesnt demand the effort required for creating a full-blown library.
Its fair to say, though, that even when...
-
Posted: August 13th, 2009, 7:00am MDT
In my last article we began putting together a solution that will allow us to display dynamic Twitter signature images in forum posts and emails. In this article well continue where we left off by adding the functions that will harness the power of GD to create the actual image.
- Before we get too involved, lets take a moment to look at the code that weve built so far.
class SignatureImage
{
private $screen_name;
private $profile_image;
private $status_text;
private $local_avatar;
public function __construct($name, $bg_image,...
-
Posted: August 12th, 2009, 7:00am MDT
Among the enhancements that were introduced originally in PHP 5, theres one powerful extension that has been all but ignored by many programmers until now, quite possibly because they werent aware of its existence. Yes, as you might have guessed, Im talking about the filter library -- a handy set of filters and functions that allow you to validate different types of data with remarkable ease.
- Thus, if youre interested in learning how to put this group of filters to work for you in a very short time, begin reading this series of articles, since in it youll find the right pointers to get you started using the filter library in a true painless fashion.
However, if you already had the oppo...
-
Posted: August 10th, 2009, 2:59pm MDT
Twitter is the latest and greatest craze in social networking sites. As such, many developers and businesses are using it as a marketing technique. Today were going to come up with a method for creating a dynamic signature image for forum posts and emails that will automatically load your Twitter feed and display your latest Twitter status. Well be using PHP to grab the content along with GD2 support to create the image.
- Im going to be presenting the code in this article in an object-oriented fashion using PHP 5. If youre not already using object-oriented programming techniques its important that you begin doing that. You will be able to take advantage of more advanced features in PHP while building more robust ...
-
Posted: August 10th, 2009, 7:00am MDT
Are you a PHP developer wishing to find an approachable guide that walks you through building different kinds of helper classes in PHP 5? Then look no further, because this group of articles may be the material that you really need.
- Welcome to the fourth part of a series on building helpers in PHP 5. Comprised of eight tutorials, this series shows how to create some of the most common types of helper classes found in many popular PHP frameworks, and it complements the corresponding theoretical concepts with numerous code sample...
-
Posted: August 6th, 2009, 7:00am MDT
The Flex Tree control is amazingly useful when building applications, especially if you're dealing with hierarchical data. To learn how to add the power of this intuitive organizational component to your developer's toolbox, keep reading.
- The Flex Tree Control is a fundamental user interface component to application building. It naturally organizes hierarchical data into branches and leaf nodes, forming easily organized data. Modern day interfaces like operating systems and websites commonly employ some version of a Tree because of i...
-
Posted: August 5th, 2009, 7:00am MDT
Welcome to the fourth part of a series covering the use of filters in PHP. In this article, you'll learn some very useful ways to take advantage of the capabilities of the filter extension to validate Boolean values in arrays; we'll also show you how to validate float numbers.
- If you ever thought that PHP 5 comes mostly from its object model, then fortunately I have to say that you're wrong. The latest version of PHP comes packaged with many other handy features that have contributed enormously to making it the mature language that it is nowadays.
However, along with ...
-
Posted: August 4th, 2009, 7:24pm MDT
Tuesday evening, August 4th, the musician Chamillionaire launched a live, first showing video on his website along with a Twitter-based chat client. While the Twitter chat client worked from a data perspective, based on what the code showed it looks like most browsers would crash.
- Chamillionaire, known for his song, quot;Ridin' Dirty quot;, announced a live event on his website located at
[www.chamillionaire.com] While traffic spiked, the site appeared to be functioning slowly but fine. However, a clever implementation of a twitter chat client may have ru...
-
Posted: August 4th, 2009, 7:00am MDT
When you program, you're usually doing it at some distance from the bits and bytes that your computer understands. There never seems to be a need to think about bits. But believe it or not, learning about bits can be to your advantage for certain programming purposes. Perl provides operators for working with bits that let you leverage this knowledge.
- For many programmers, bits aren't an issue that receives any serious attention. Whenever someone mentions a bit, they get a vague idea of ones and zeros strung together, deep within the heart of a computer, at a level they don't have to work with or even think about. Creating a functioning program, ...
-
Posted: August 3rd, 2009, 7:00am MDT
In this third installment of a series on building helpers in PHP 5, I will provide you with the basic pointers for building a URL-handling helper class. The code examples, though simple, should serve to demonstrate how to create a helper that generates dynamic URLs.
- Undeniably, helper classes are one of the most useful resources found in a PHP developer's toolbox. They present several distinctive characteristics that make them look quite different from a typical full-blown library: on the one hand, they're built as small packages of logically-related methods, ...
-
Posted: July 30th, 2009, 7:00am MDT
BlackBerrys Java Development Environment (JDE) is crucial for a developer to understand, because it's the heart and soul of the development process. The JDE is a fully-integrated development environment and simulation tool for building Java Platform, Micro Edition (Java ME) applications. BlackBerrys JDE is a Mobile Information Device Profile (MIDP) compliant Java ME environment, which is ideal for developers who want to uphold seamless portability in their wireless applications.
- In addition to supporting MIDP 2.0, JDE also allows use of hundreds of proprietary BlackBerry APIs to take full advantage of the BlackBerry platform specific features that are not available on other smartphones in the market. As if that's not enough, the BlackBerry Java Development Environment also ...
-
Posted: July 29th, 2009, 7:00am MDT
Among the numerous libraries that come included by default with the PHP 5 distribution, theres one that has been overlooked by many developers. This is a shame, because it can be really useful for validating incoming data in a truly simple fashion. Im talking about the filter extension, a powerful set of functions that let programmers apply several filters to multiple PHP variables to perform all sorts of clever validations, ranging from checking for integer and float numbers, to verifying email addresses and URLs.
- Therefore, if you feel curious and wish to learn how to incorporate the filter extension into your web developers toolbox, then dont hesitate anymore; start reading this group of articles now!
Welcome to the third part of the series on using filters in PHP 5. Comprised of seven tutorials, this ser...
-
Posted: July 28th, 2009, 6:26pm MDT
The on-again, off-again relationship between Microsoft and Yahoo! appears to be back on, though cautiously. The announcement about the ad partnership between MSFT and YHOO should be announced by Thursday Morning.
- Yahoo!, once a giant of the search engine world has joined an alliance with Microsoft and one assumes the Bing search engine. While details are not available yet on what this means to Yahoo's earnings, the stock is up about 1.6% in after-hours trading at 8PM Tuesday evening.
Last year, Microsof...
-
Posted: July 28th, 2009, 7:00am MDT
BlackBerry and Java have a long and storied history together. Since the launch of the BlackBerry 5810 in 2002, all BlackBerry smartphones have been Java-based. All core BlackBerry applications have been written in Java. As you can see, there are many benefits to being familiar with Java, especially as it pertains to being a BlackBerry developer.
- Using Java to develop apps enables developers to create incredibly rich client applications, and the Java APIs that are already available on BlackBerry smartphones ensure that a developer has more control when it comes to providing customizable user interfaces, event listening, and system interfaces...
-
Posted: July 27th, 2009, 7:00am MDT
Theoretically defining the role of helper classes in PHP 5 (and other popular server-side scripting languages) is a pretty approachable process. As their name suggests, helper classes provide developers with a set of logically-grouped methods that allow them to easily perform certain repetitive tasks that are common to different web applications. This is the second part of an eight-part article series that shows you how to build a variety of useful helper classes and expand on their functionality.
- Typical examples of helper classes are those that dynamically build portions of a URL and validate incoming data, or that apply specific text-formatting filters to a supplied string before doing something useful with it, such as inserting it into a database table. Feel free to add your own to the ...
-
Posted: July 24th, 2009, 10:06pm MDT
Microsoft is releasing a security patch for Visual Studio and another moderate rated patch for IE for almost all versions. The patches are must-haves for developers that use Visual Studio and any internet explorer users.
- Here comes another critical patch from Microsoft. What it fixes is anyone's guess, but it affects almost all versions of Windows and .NET Visual Studio back to 2003. Developers are encouraged to register their guess, but make your guesses after you apply the patch.
Speculation is that the Inter...
-
Posted: July 23rd, 2009, 7:00am MDT
The Java platform is ideal for any developer who wants to create rich client apps, because it is capable of providing the most flexibility and power. The possibilities are literally endless because Java can be used to create a wide array of applications that feature a broad reach in terms of functionality. Whether you want to create games or corporate apps, its all possible using Java.
- Java development enables users to take advantage of many BlackBerry smartphone features, such as the camera, GPS and Bluetooth, and integrate those features seamlessly with already-existing BlackBerry apps such as the address book, calendar, and maps features. The only downfall -- if it could even b...
-
Posted: July 22nd, 2009, 11:14pm MDT
Recent attacks against the United States IT security infrastructure has officials worried that, over the next decade, qualified cyber-security personnel will be at a premium; and a shortage. The question is: how does the USA plan to lure and keep top tech talent to secure and protect the national information infrastructure?
- There's a definite digital-divide starting, but it's not between the rich and the poor; it's between the IT Security expert haves and have-nots...and it's spreading from private companies all the way to the US Government.
Recent studies of the country's top IT management shows that a whopping 35%+ ...
-
Posted: July 22nd, 2009, 7:00am MDT
As you know, when it comes to validating incoming data, PHP 5 comes bundled with a powerful set of native functions that allow you to perform all sorts of clever validations on a given variable. This includes checking for numeric values, arrays, strings, and objects as well. However, the best feature of the helpful validation capabilities offered by default by PHP 5 is its handy filter extension, even though it has been overlooked by many programmers so far.
- Indeed, this library of filters also permits you to perform powerful validation on variables in a pretty straightforward fashion, without the need to define custom and complex functions. So, if youre interested in learning how to use these filters within your own web applications, then this group of...
-
Posted: July 21st, 2009, 7:00am MDT
One of the reasons BlackBerry devices have become so popular is that they are very intuitive to use. As a developer, you will need to make sure the applications you build for BlackBerries fit this model. But how do you build an intuitive app? Keep reading.
- BlackBerry devices have obviously become the dependable, go-to device for corporate networks, such as IT, as well as financial and government networks. There are a number of different reasons that make this particular smartphone so appealing to developers. One of these reasons is how connected Black...
-
Posted: July 20th, 2009, 7:00am MDT
Tired of repetitive coding for tasks such as generating web site breadcrumbs? PHP 5 provides a number of interesting ways to reuse your code so you can let the boring stuff take care of itself. This eight-part series will show you how to create helpers to take care of repetitive tasks and free up your precious coding time for the real challenges.
- When it comes to speeding up the development of web applications, experienced PHP programmers tend to be rather lazy, and I'm not using that adjective with a negative connotation. Popular concepts like don't reinvent the wheel and DRY (short for don't repeat yourself ) help developers avoid cr...
-
Posted: July 16th, 2009, 7:00am MDT
Device simulators help developers by letting them get as close as possible to running their applications on the real thing. Fortunately, there are some very good BlackBerry simulators available, which can save developers a great deal of time when creating applications.
- It could be said that historically BlackBerry has always been a messaging platform. The first versions of RIM smartphone devices were little more than glorified pagers. Today, of course, BlackBerry smartphones are a one-stop-shop for productivity, acting as an integrated telephone, text, e-mail, and...
-
Posted: July 15th, 2009, 7:00am MDT
You've probably built custom functions and libraries to validate user input in PHP 5. There's an easier way to do this, and it can save you considerable time and effort. It involves using PHP 5's own built-in and often-neglected filters. This nine-part series will introduce you to their use.
- Definitely, one of the most common tasks that PHP programmers have to tackle during the development of web applications is validating user-supplied data. This fact brings up a crucial and mandatory rule: the client side is always non-trusted terrain with little or no control. Consequently, any data ...
-
Posted: July 14th, 2009, 7:00am MDT
It seems as if everyone uses a BlackBerry these days. But not everyone organizes their information in quite the same way. If you're going to build the programs that help people stay organized with BlackBerry devices, you need to understand the kinds of data types that users acquire, organize, and use to get through the day.
- Its safe to say that BlackBerry devices have become such a necessity for many people because as a society, we need them to help keep track of our lives. Were busier than ever before and that doesnt just apply to those in the business world. Its no longer unusual to see a stay-at-home mom or dad with...
-
Posted: July 13th, 2009, 7:00am MDT
You are planning to develop a PHP web application that needs a MySQL database. Now what? You need to design your MySQL database first. Need a little help? Keep reading.
- Most developers do not have a design background regarding MySQL, so when they create their database, it's inefficient, buggy and unreliable.
By properly setting up the correct specifications for your MySQL database, your web application will be efficient and reliable, since it meets industry stand...
-
Posted: July 9th, 2009, 7:00am MDT
A lot of people are stuck in a rut, a complete web browsing rut. You use the same browser over and over again in the same old ways. It is a shame if you are one of those people. You are only cheating yourself out of the rich variety that the web has to offer you. It's time to explore the many other browser flavors out there. This article will give you a taste.
- What are some of the advantages to checking out a non mainstream web browser?
First, you will get to see your favorite web sites, or any sites that you happen to own, in a whole new way. If you've only ever viewed pages through one browser, then you may not know that different rendering engines wil...
-
Posted: July 8th, 2009, 9:33am MDT
Dell, looking to further it's $15 billion dollar business to the public sector, announces it will offer a Digital Forensics Service based on specific computer hardware and software. Looks like Michael Dell is ready to film CSI: Texas with their new Forensics unit.
- Dell's Forensics Service, based on a partnership with Intel, provides police with a helpful set of tools to help analyze crime scenes, gather more specific evidence and track data in a self-hosted environment. With this set of forensic tools, Dell hopes to help police use computer technology to ga...
-
Posted: July 8th, 2009, 7:00am MDT
JavaScript is an online scripting language that is implemented and works directly with HTML pages. Similar to Flash and ActionScript, JavaScript brings a dynamic nature to web pages that does not require the page to change. Obviously, this functionality is very useful for a wide variety of reasons. JavaScript can make a developers life a lot easier in a lot of ways. On the other hand, the various down sides of implementing JavaScript are significant sometimes too much so.
- Any time that a developer would like to change the content of a web page without actually changing the page, JavaScript is a natural option. Flash and ActionScript is basically the only other option. A developer may decide to use JavaScript for a variety of reasons, many of which include the various...
-
Posted: July 7th, 2009, 7:00am MDT
The List Control is a fundamental control for use in Flex. It can be used in many different situations and can display all types of data. Anything from images to plain text and even basic HTML (supported by Flex) can be used. Keep reading for an introduction to this versatile control.
- Creating a Basic List with XML Data
Whether you're developing large scale applications or just quick tools, you'll more than likely need to use a list when developing your applications. In this article, I cover the creation of a basic List Control with data population via XMLList. In my next articl...
-
Posted: July 6th, 2009, 7:00am MDT
Doing PHP queries to a MySQL database is one of the most important processes in any web application. This is where data is being fetched from or inserted into the database. If you are a beginning PHP web developer, then learning the most important MySQL queries is essential to your success in dealing with dynamic websites.
- You can see dynamic websites almost everywhere on the net. Popular software packages, whether for blogging (like WordPress or Drupal) or e-commerce (such as osCommerce) are configured to be dynamic in nature. Dynamic websites rely on MySQL databases to fetch and insert data coming from and going to ...
-
Posted: July 2nd, 2009, 9:48pm MDT
An amazing breakthrough in artificial intelligence by MilePost GCC allows development to speed up 10x by employing learning techniques to become the first intelligent, open-source compiler.
- SmarterTechnology reports that the Milepost project at www.milepost.eu, in conjunction with IBM Research, has developed an intelligent, open-source compiler that essentially uses collaborative development as it's source to produce compiled code 10x faster.
Yes, your compiler has joined the BORG, bu...
-
Posted: July 2nd, 2009, 7:00am MDT
Welcome to the final part of an eight-part series on building loader applications in PHP. In this part, we'll improve on the loader class we developed in the previous part by using certain specific functions from the Standard PHP Library (SPL).
- Among the bunch of useful features that were incorporated into PHP 5 a long time ago, aside from the improved object model, there's also a set of functions and classes that comprise what's commonly called the Standard PHP Library (SPL).
As you may have heard, this library permits you to perform sev...
-
Posted: July 1st, 2009, 7:00am MDT
Welcome to the seventh installment of an eight-part series on building loader applications in PHP. In this part, you will learn how to use the spl_autoload(), spl_register() and spl_register() functions to build a small file loader class. This class will be able to perform recursive searches through the file system to find a targeted resource.
- As the passionate PHP developer that you probably are, you know that building file loading scripts is mostly a process that relies on the set of include()/include_once() and require()/require_once() functions, which youve surely used hundreds of times before.
Nevertheless, its feasible to creat...
-
Posted: June 30th, 2009, 7:00am MDT
Flex 3.0 offers a strong foundation of user interface (UI) controls by which users can harness a great deal of power to create beautiful UIs without having to toil in the details of low level functionality. Of these controls, the DataGrid sets itself apart by offering characteristics similar to a list or tree control (which are also listBase controls), but going further to offer an easy way of displaying columnar data without a complicated interface. In this article, I focus on creating a basic DataGrid and populating it with XML data by using only MXML tags.
- Creating a Basic Data Grid
Flex provides an
MXML tag to create a DataGrid. Here is our application, with the DataGrid colored in blue:
lt;?xml version= quot;1.0 quot; encoding= quot;utf-8 quot;? gt;
lt;mx:Application xmlns:mx= quot
[www.adobe.com] quot; layout= quot;absolu...