Description
form_prepare takes data from either the GET or POST super global and sanitizes, and filters it against an optional set of rules. The santizing is tailored to a specific target. It then appends a digital signature to the return array so that you may validate the array contents in the future.
Parameters
$method: (GET, POST) The super global which contains the form data. [type:array]
$target: EMAIL, DATABASE, or BROWSER. [type:string]
$rules:
Return Values
On Success: Sanitized form data [type:array] On Failure: False[type:boolean]
Notes
The signature can be found in the array field 'monju_hash'
Examples
$rules['identifier'][0] = true; $rules['identifier'][1] = ALPHA; $rules['email'][0] = true; $rules['email'][1] = '/.*@[a-z]+\.com/'; $prepared = form_prepare('POST', 'DATABASE', $rules); // can now use in form_dispatch()
Dependencies
- monju.lib.php
If you notice a mistake in the documentation, instead file a bug report in the issue tracker. Instead use this to add tips and tricks associated with the functions. You can use tags like to keep your comments clear.