Screencast: Quick PHP Form Validation with PEAR
Note: I hope the quality is manageable. If I do another screencast I’ll be working on improving it.
You can download the script I wrote in this tutorial from here.
Links
PEAR Website – http://pear.php.net/
PEAR go-pear Script – http://pear.php.net/go-pear
PEAR Validate Package – http://pear.php.net/package/Validate
















7 Comments
To get your own globally recognized avatar visit http://www.gravatar.com/
Ian 11th, September 2008 at 7:14 pm
"I've come across a pear"
Well, whatever floats your boat Ry....
jesusvld 12th, September 2008 at 10:23 pm
Excelent!!!
Sam 24th, November 2008 at 8:48 pm
Great tutorial. Looking forward to more.
One thing I ran into, when trying to validate a field using the format VALIDATE_NAME in the opts array:
'first_name' => array('type' => 'string',array('format'=>VALIDATE_NAME))
it kept failing when validating names with apostrophes, until I realized that magic_quotes_gpc was on, so in the value array:
'last_name' => $p_last_name,
needs to become
'last_name' => stripslashes($p_last_name),
Hope this helps someone out there.
Danilo 2nd, December 2008 at 3:19 pm
Thanks for screencast, it was very useful for me :)
Ned 13th, December 2008 at 4:27 am
Absolutely tremendous. I was looking to learn about Validate and I learned that and a whole lot more in this screencast.
Thank you sir.
Ahmad 13th, April 2009 at 7:08 pm
Thanks very much
I hope you see more tutorials for you
Ahmad 13th, April 2009 at 7:10 pm
I mean I hope see more tutorials for you
sorry