Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Forms Validation

by Anonymous Monk
on May 04, 2011 at 07:58 UTC ( [id://902828]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello there :)

I would like to validate http post (html form) data.

I've had a quick look at CGI::Validate (which seems quite dated) and CGI::Ex::Validate (which looks quite nice).

Before I spend several hours learning the chosen module and how I can implement it in my code, can anyone recommend which one I should use or, if there are other perhaps better ones out there ?

I will be processing input that will be going to an SQL database and I am aware of the dangers of injection and XSS.

Many thanks and have a nice day :)

Replies are listed 'Best First'.
Re: Forms Validation
by Khen1950fx (Canon) on May 04, 2011 at 10:31 UTC
    Take a look at Data::FormValidator::Constraints::HTTP. For example, to validate POST:
    #!/usr/bin/perl use strict; use warnings; use Data::FormValidator; use Data::FormValidator::Constraints::HTTP qw( POST ); BEGIN { my %profile = ( required => [ qw( method ) ], constraint_methods => { method => POST, }, ); my $results = Data::FormValidator->check( { method => 'POST' }, \%profile ); }
Re: Forms Validation
by andreas1234567 (Vicar) on May 04, 2011 at 13:06 UTC
    Take a look at Params::Validate.
    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
Re: Forms Validation
by stonecolddevin (Parson) on May 04, 2011 at 16:45 UTC

    I highly recommend Data::Manager

    Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://902828]
Approved by citromatik
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-19 00:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found