Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.255.375 Times

CGI::Validate 2.000

  Date Added: January 04, 2010  |  Visits: 1.046

CGI::Validate

Report Broken Link
Printer Friendly Version


Product Homepage
Download (101 downloads)



CGI::Validate is an advanced CGI form parser and type validation. SYNOPSIS use CGI::Validate; # GetFormData() only use CGI::Validate qw(:standard); # Normal use use CGI::Validate qw(:subs); # Just functions use CGI::Validate qw(:vars); # Just exception vars ## If you dont want it to check that every requested ## element arrived you can use this. But I dont recommend it ## for most users. $CGI::Validate::Complete = 0; ## If you dont care that some fields in the form dont ## actually match what you asked for. -I dont recommend ## this unless you REALLY know what youre doing because this ## normally meens youve got typos in your HTML and we cant ## catch them if you set this. ## $CGI::Validate::IgnoreNonMatchingFields = 1; my $FieldOne = Default String; my $FieldTwo = 8; my $FieldThree = some default string; my @FieldFour = (); ## For multi-select field my @FieldFive = (); ## Ditto my $EmailAddress= ; ## Try... my $Query = GetFormData ( FieldOne=s => $FieldOne, ## Required string FieldTwo=i => $FieldTwo, ## Required int FieldThree => $FieldThree, ## Auto converted to the ":s" type FieldFour=s => @FieldFour, ## Multi-select field of strings FieldFive=f => @FieldFive, ## Multi-select field of floats Email=e => $EmailAddress, ## Must look like an email address ) or do { ## Catch... (wouldnt you just love a case statement here?) if (%Missing) { die "Missing form elements: " . join ( , keys %Missing); } elsif (%Invalid) { die "Invalid form elements: " . join ( , keys %Invalid); } elsif (%Blank) { die "Blank form elements: " . join ( , keys %Blank); } elsif (%InvalidType) { die "Invalid data types for fields: " . join ( , keys %InvalidType); } else { die "GetFormData() exception: $CGI::Validate::Error"; } }; ## If you only want to check the form data, but dont want to ## have CGI::Validate set anything use this. -You still have full ## access to the data via the normal B object that is returned. use CGI::Validate qw(CheckFormData); # not exported by default my $Query = CheckFormData ( FieldOne=s, FieldTwo=i, FieldThree, FieldFour, FieldFive, Email, ) or do { ... Same exceptions available as GetFormData above ... }; ## Need some of your own validation code to be used? Here is how you do it. addExtensions ( myType => sub { $_[0] =~ /test/ }, fooBar => &fooBar, i_modify_the_actual_data => sub { if ($_[0] =~ /test/) { ## data validation $_[0] = whatever; ## modify the data by alias return 1; } else { return 0; } }, ); my $Query = GetFormData ( foo=xmyType => $foo, bar=xfooBar => $bar, cat=xi_modify_the_actual_data => $cat, ); ## Builtin data type checks available are: s string # Any non-zero length value w word # Must have at least one w char i integer # Integer value f float # Float value e email # Must match m/^s*]+@[^@.<>]+(?:.[^@.<>]+)+>?s*$/ x extension # User extension type. See EXTENSIONS below. Basicly a blending of the CGI and Getopt::Long modules, and requires the CGI module to function. The basic concept of this module is to combine the best features of the CGI and Getopt::Long modules. The CGI module is great for parsing, building, and rebuilding forms, however it lacks any real error checking abilitys such as misspelled form input names, the data types received from them, missing values, etc. This however, is something that the Getopt::Long module is vary good at doing. So, basicly this module is a layer that collects the data using the CGI module and passes it to routines to do type validation and name consistency checks all in one clean try/catch style block. The syntax of GetFormData() is mostly the same as the GetOptions() of Getopt::Long, with a few exceptions (namely, the handling of exceptions) . See the VALUE TYPES section for detail of the available types, and the EXCEPTIONS section for exception handling options. If given without a type, fields are assumed to be type ":s" (optional string), which is normally correct. If successful, GetFormData() returns the CGI object that it used to parse the data incase you want to use it for anything else, and undef otherwise. If you only want to do value type and name validation, use CheckFormData() instead with a field=type list. -See the SYNOPSIS for an example..

Requirements: No special requirements
Platforms: Linux
Keyword: Cgi Form Cgivalidate Data Dont Fieldfive Fieldfour Fieldthree Fieldtwo Form Getformdata Module Type Want To
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


CGI::VALIDATE RELATED
Modules  -  Form Adjust 6.x-1.x-de
The Form Adjust module allows you to make a variety of modifications on any form available in your Drupal installation. You can change any field's property value, like #title, #description or #value. Every change is done by adding a new...
10 KB  
Libraries  -  CGI::Minimal 1.25
CGI::Minimal is a lightweight CGI form processing package. SYNOPSIS # use CGI::Minimal qw(:preload); use CGI::Minimal; my $cgi = CGI::Minimal->new; if ($cgi->truncated) { &scream_about_bad_form; exit; } my $form_field_value =...
29.7 KB  
Modules  -  Protx Form Payment Module 1.0.9
This is a payment module for the protx form system.
 
Web Authoring  -  Visual Form Mail 1.6
Visual Form Mail makes it easy to create powerful and secure CGI scripts to process forms on your website. You can create scripts that validate the information entered by users, send custom email messages (such as a "thank you" or confirmation to...
829.44 KB  
Libraries  -  CGI::FormMagick 0.89
CGI::FormMagick is a Perl module to easily create CGI form-based applications. SYNOPSIS use CGI::FormMagick; my $f = new CGI::FormMagick(); # all options available to new() my $f = new CGI::FormMagick( type => file, source =>...
75.78 KB  
HTML Utilities  -  Visual Form Mail Standard 1.1
Visual Form Mail makes it easy to create powerful and secure CGI scripts to process forms on your website. You can create scripts that validate the information entered by users, send custom email messages (such as a "thank you" or confirmation to...
850 KB  
Libraries  -  CGI::kSession 0.5.3
CGI::kSession is a sessions manager for CGI. This module can be used anywhere you need sessions. As a session management module, it uses files with a configurable lifetime to handle your session data. For those of you familiar with PHP, you will...
4.1 KB  
Multimedia & Graphics  -  Plasmid Entry Form 1.2
Plasmid Entry Form is a simple, easy to use application designed to help you create plasmid database forms for BGME lab. This program presents user with a data entry form for entering plasmid information and automatically converts DNA sequence...
 
Modules  -  Paranoid Form Validator 6.x-1.0
Paranoid Form Validator can be used to prevent security attacks (cross-site scripting, SQL injection) carried out by submitting forms with malicious data in some cases. It works by adding extra validation to forms and raising error if unsafe data...
10 KB  
Web Site Promotion  -  JS Auto Form Validator 3.3.3
The JS Auto Form Validator is an easy-to-setup form validation script which enables you to handle the whole form validation process without writing any JavaScript code. This script allows you to specify certain form elements as "required" or...
93.22 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB