Home arrow PHP arrow Sanitizing User Input for an MVC-based Framework in PHP 5

Sanitizing User Input for an MVC-based Framework in PHP 5

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.

TABLE OF CONTENTS:
  1. Sanitizing User Input for an MVC-based Framework in PHP 5
  2. The framework's current source files
  3. Building a basic input class
  4. Listing the framework's full source code
By: Alejandro Gervasio
Rating: starstarstarstarstar / 2
June 14, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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 exploit its functionality when developing your own web-based applications.

The MVC design pattern can be applied in multiple situations and projects; this includes the construction of frameworks. Well-established frameworks like the Zend Framework and Ruby on Rails, to cite a couple of examples for different scripting languages, have implemented this approach very successfully for rapid application development.

However, you may want to learn how to use the MVC paradigm for building a basic framework in PHP 5, either for expanding your existing programming skills, or only for fun. If that's the case, in this group of articles you'll find a step-by-step guide that will show you how to create an MVC-based framework using PHP 5, which you can use as a starting point for building your own, or for understanding more clearly how other frameworks function internally.

Of course, if you've already read the three articles that precede this one, then  you'll have a more accurate idea of how to build a framework like the one mentioned above. In those tutorials I started creating the framework's front controller and its default ".htaccess" file, and based upon this initial structure I added a few more components, including a router/dispatcher module and a MySQL abstraction class.

Even so, this sample framework in its current state lacks many features that I plan to incorporate in future tutorials. In this one, though, I'm going to provide it with the ability to basically sanitize user-supplied data through a simple input class.

Want to find out how this brand new class will be developed? Then click on the link below and start reading now!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: