HTML Forms Generation and Validation PHP Class 1.0 BETA 3
Saturday, February 17, 2007HTML Forms Generation and Validation PHP Class, News
A new version of the HTML Forms Generation and Validation PHP Class has been released. Read further to see what is new in this version of the script.
What's new in this version:
- for the 'select' control, if options were specified having literal keys and the 'mandatory' rule was set, the control would never pass validation (thanks to sridhar for reporting)
- a major security issue was fixed where an attacer could inject arbitrary HTML and/or JavaScript code along with the submitted data. now all the submitted data is passed through the htmlentities() function and, if magic_quotes are on, are stripslashed (thanks to Bartosz for reporting this one)
- file uploads were not working because neither "enctype" nor MAX_FILE_SIZE were set upon the rendering of the form
- if you would set a checkbox's state as "checked" by default, any subsequent submits would set the checkbox's value to "checked" even if user would uncheck it (thanks to sridhar for reporting)
- "mandatory" rule could not be set to the "file" control (thanks to sridhar for reporting)
- a new method was added: "addVar()". through this method, user defined variables can be made accessible from within the form's template file
- added a new control: "captcha" which generates CAPTCHA images
- password controls no longer re-display the entered value
March 29, 2007 6:50 AM
Hello Stefan,
How would you recommend handling multiple forms & templates. Would the following implementation be ok?
// Validate the form
if ($form1->validate()) {
// Validate Next
if ($form2->validate()) {
// Form2 Validated
.... do final processing
}
$form2->render "example2.xtpl");
}
$form1->render("example.xtpl");