PHP
  Home arrow PHP arrow Adding Validation to an Image Generato...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
OLM
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Adding Validation to an Image Generator Class with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-10-02

    Table of Contents:
  • Adding Validation to an Image Generator Class with PHP 5
  • Recalling the initial definition of the image generator class
  • Validating incoming parameters
  • The improved signature of the ImageGenerator class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    Adding Validation to an Image Generator Class with PHP 5
    (Page 1 of 4 )

    Among the plethora of applications that can be developed with PHP 5, building dynamic image streams is one of the easiest to tackle. It requires only an intermediate background in the functions that come packaged with the powerful GD extension. This series of articles will teach you how to use this graphic library to build a highly expansible image generator class that can be used to create noisy images (also known as captchas).

    Introduction

    Welcome to the second installment of the series that began with "Building a Image Generator Class with PHP 5." In accordance with the series title, these tutorials will guide you through the development of a highly pluggable PHP 5-driven class, which can be useful for embedding dynamically several input strings into a variety of popular graphic formats, including JPG, GIF and PNG.

    If you already read the preceding article of the series, I assume that the logic implemented by the image generator class that I developed in that tutorial is now familiar to you. However, to clarify the way this class did its business, let me quickly refresh some key concepts regarding its programmatic functionality.

    As you"ll probably recall, the class in question was provided with the ability to create dynamic image streams which contained an embedded text string that was logically passed as an input argument to the class constructor. Also, even though the structure of this class was rather primitive, it was flexible enough to allow us to perform some useful tasks, like displaying on the browser different text strings in a specific graphic format.

    Of course, if you analyze the functionality of this image generator class, you might find it rather limited. Nonetheless, it"s possible to couple the class in its current version to other web applications, including banner and noisy images systems.

    But, actually I'm getting ahead of myself. In this second part of the series I'll show you how to introduce some important modifications to the initial skeleton of the image generator class, to make it slightly more modular and independent, while maintaining its functionality nearly the same as before. Sounds pretty interesting, right?

    So, having already introduced the subject of this second installment of the series, it's time to learn how to modify the original signature of this PHP 5-driven image generator class to improve its overall structure. Are you ready to begin? Let's get started!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this second part of the series, the basic definition of the image...
       · Hello there,I copied the code with minimun changes, and tried to call on the...
       · Thank you for the comments about my PHP article and I’m glad to know you’re getting...
       · Thanks for your quick reply... I really thought that it would not matter if you...
       · Thank you again for your post. So, it seems the problem comes up from your web...
       · Instead of:if(strlen($inputString>255)){Should...
       · Thank you for pointing out to me that little bug in the class code.Regards.
     

       

    PHP ARTICLES

    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway