Next we join the processing function of the form.
FORM2.PHP
pear :: html_quickform title> head> Require_once ("html / quickform.php"); $ form = new html_quickform ('frmtest', 'post'); $ Form-> addelement ('header', 'header', 'please login'); $ form-> addelement ('text', 'name ",' username: '); $ form-> addelement (' password ', 'password', 'password:'); $ form-> addelement ('Submit', '', 'submit'); if ($ form-> validate ()) {$ form-> process ('sign_hello'); } else {$ form-> display ();} function sign_hello ($ data) {print 'Hello,'. $ data ['name']; print '
'; Print 'Your Password is'. $ data [ 'Password'];}?> body> html>
effect:
After clicking the submit button
In this code, we designed a SAY_HELLO () function to handle the form and call through $ form-> process ().
The data input to the form is saved in a $ data array that can be passed to the SAY_HELLO () function.