Beispiel #1
0
{
    $arr["password"] = md5($arr["password"]);
    return $arr;
}
//checking if user logged in
if (!isset($_SESSION["user"])) {
    echo "<p>Not logged in</p>";
} 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"])) {
Beispiel #2
0
    } else {
        return false;
    }
}
//modifying values - hashing password
function hash_pass($arr)
{
    $arr["password"] = md5($arr["password"]);
    return $arr;
}
//class instance
$form = new auto_form($serverlink);
//debug queries
$form->debug();
//setting callback functions
$form->add_custom_validation("pass_match", "Repeated password didn't match");
$form->add_custom_validation("check_email", "Incorrect email format");
$form->set_modification("hash_pass");
//excluding table columns
$ex = array("ID", "password");
//providing form language
$lang = array("username" => "Username", "email" => "Email address", "firstname" => "Firstname", "lastname" => "Lastname", "password" => "Password", "repeat_pass" => "Reapeat password", "gender" => "Gender");
$form->set_language($lang);
/*************************
 * Generating form
 *************************/
echo "<fieldset>";
echo "<legend>Register</legend>";
//adding custom password field
$html = "<input type='password' name='password'";
if (isset($_POST["password"])) {