mod_form iconmod_form 1.0

mod_form is a utility to decode data submitted from Web forms.
mod_form is a utility to decode data submitted from Web forms. It deals with both GET and POST methods where the data are encoded using the default content type application/x-www-form-urlencoded.

mod_form does not decode multipart/form-data (file upload) forms: for those you should use mod_upload.

Usage:

When mod_form is active, form data will be decoded to an apr_table_t*. Modules can access the table using the optional function form_data, or individual form fields using form_value:

#include "mod_form.h"

some_func(request_rec* r) {
apr_table_t* (*form_vars)(request_rec*) ;
apr_table_t* (*form_lookup)(request_rec*, const char*) ;
apr_table_t* form_data ;
const char* val ;
const char* key = "some-form-field" ;

/* get the whole table */
form_vars = APR_RETRIEVE_OPTIONAL_FN(form_data) ;
if ( form_vars ) {
form_data = form_vars(r) ;
}

/* or get individual values */
form_lookup = APR_RETRIEVE_OPTIONAL_FN(form_value) ;
if ( form_lookup ) {
val = form_lookup(r, key) ;
}
}

last updated on:
May 16th, 2006, 18:01 GMT
price:
FREE!
developed by:
Nick Kew
license type:
GPL (GNU General Public License) 
category:
ROOT \ Internet \ HTTP (WWW)

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Add your review!

SUBMIT