예제 #1
0
} else {
    echo "<p>Logged in</p>";
}
//class instance
$form = new auto_form($serverlink);
//debug queries
$form->debug();
//setting callback functions
$form->add_custom_validation("valid_captcha", "Incorrect captcha entered");
$form->set_onsuccess("login");
$form->set_modification("hash_pass");
//excluding table columns
$ex = array("ID", "firstname", "lastname", "email", "password", "gender");
//providing form language
$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