Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 198 by
animestr...@gmail.com: Error always appears
http://code.google.com/p/php-form-builder-class/issues/detail?id=198
include("PFBC/Form.php");
$error = false;
$form = new Form("validation");
$form->addElement(new Element_Hidden("action", "update_user"));
$form->addElement(new Element_Password(__('Password'), "password", array(
"required" => 1
)));
$form->addElement(new Element_Password(__("Confirm
Password"), "confirmpassword", array(
"required" => 1
)));
$form->addElement(new Element_Email(__("Email"), "email", array(
"required" => 1,
"value" => $userinfo['email']
)));
$form->addElement(new Element_Password(__('Old Pasword'), "oldpass", array(
"required" => 1
)));
$form->addElement(new Element_Button);
$form->addElement(new Element_Button("Cancel", "button", array(
"onclick" => "history.go(-1);"
)));
// echo resultBlock($errors, $successes);
if (Form::isValid("validation")) {
// print_r($_POST);
$error = false;
if ($_POST["password"] != $_POST["confirmpassword"]) {
Form::setError("validation", __("Error: Confirm password does not
match with new password"));
$error = true;
}
$entered_pass = generateHash($_POST['oldpass'], $loggedInUser->hash_pw);
if ($entered_pass != $loggedInUser->hash_pw) {
Form::setError("validation", __("Error: Wrong old password"));
$error = true;
}
if ($error == false) {
Form::clearValues("validation");
$stmt = $mysqli->prepare("UPDATE " . $db_table_prefix . "users
SET
email = ?,
password = ?
WHERE
id = ?");
$newpass = generateHash($_POST['password']);
$stmt->bind_param("ssi", $_POST['email'], $newpass, $id);
$result = $stmt->execute();
$stmt->close();
$successes[] = __("Updated settings");
}
}
Whenever I load the form, the errors always appear, any idea why?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings