コード例 #1
0
ファイル: login_example.php プロジェクト: eyumay/srms.psco
$lang = array("username" => "Username", "password" => "Password", "captcha" => "Enter captcha", "code" => "Captcha code");
$form->set_language($lang);
/*************************
 * Generating form
 *************************/
echo "<fieldset>";
echo "<legend>Login</legend>";
//adding custom password field
$html = "<input type='password' name='password'";
if (isset($_POST["password"])) {
    $html .= " value='" . $_POST["password"] . "'";
}
$html .= "/>";
$form->add_custom_html($html, "password", true);
//adding class predefined validation fo password
$form->add_class_validation("password", "char", true);
//displaying captcha code
$form->add_custom_html($captcha, "code", false);
$html = "<input type='text' name='captcha' style='text-transform: uppercase;' maxlength='5'";
if (isset($_POST["captcha"])) {
    $html .= " value='" . $_POST["captcha"] . "'";
}
$html .= "/>";
//adding custom captcha input
$form->add_custom_html($html, "captcha", false);
//adding class predefined validation for captcha
$form->add_class_validation("captcha", "char", true, 5);
//generating form
$form->select_form("test_users", $ex);
echo "</fieldset>";
ob_end_flush();