Posts Tagged ‘update’

PHP Form Processor – version 2!

Thursday, January 1st, 2009

Happy new year everybody! I’d thought I’d start off the new year with a little present for you all.. the new version of my PHP Form Processor. Thanks to Andrew Dunn for some excellent ideas on how to improve the processor, as well as for tweaking bits of code here and there, I’m able to bring you version 2 of the form processor.

The last few months has seen some additional functionality added, as well as fixing a few bugs here and there. Version 2 of the processor is fully backwards compatible with version 1, so don’t panic!

Here’s a brief summary of the changes:

  • Callbacks added to radio buttons
  • All functions now declared as public or private respectively
  • A configuration system, which lets you change the behaviour of the form processor
  • The ability to echo the form output or save it to a variable (useful for templating systems)
  • A text transform rule has been added, which allows you to set text to be lowercase, uppercase or uppercase the first letter of each word
  • A minimum length rule has been added, which allows you to set the minimum number of characters a user must enter
  • A maximum length rule has been added, which allows you to set the maximum number of characters a user must enter
  • Cleaned up the code
  • Swapped exit() statements with exceptions, so these can be caught and handled if necessary

I’ve also created a few example forms to show the functionality of the form processor. Please take a look at the PHP Form Processor article for full details.

Gavin Holt is also doing a series of articles demonstrating practical usage of the form processor. Check it out for some excellent ideas and usage examples.

DOWNLOAD THE PHP FORM PROCESSOR