|
|
|
|
|
|
Arguments:
Name |
Description |
$field |
The field where you want to get the value from |
Description:
Return the value of the field which fieldname is given to this function.
When the database option is used, it's also possible to get a value from the database (also when the field is not in the form!).
Example
Simple example of retrieving a value from a field and using it.
<?php
// include the class
include("FH3/class.FormHandler.php");
// create new formhandler object
$form = new FormHandler();
// passfield
$form -> passField("Password", "password", FH_STRING);
// get the value from the field
$value = $form -> value("password");
// save the password MD5 encrypted
// SO OVERWRITE THE CURRENT VALUE!
$form -> addValue("password", md5( $value )
);
// submitbutton
$form -> submitButton("Save");
// set the onCorrect function
$form -> onCorrect("doRun");
// flush
$form -> flush();
// commit after form function
function doRun( $data )
{
echo "MD5 encrypted password: ".$data['password'];
}
?>
|
See also: GetValue
Latest change: 05 March 10 / 08:51
Comments
|
|
|
|