Issue 198 in php-form-builder-class: Error always appears

17 views
Skip to first unread message

php-form-bu...@googlecode.com

unread,
Apr 8, 2013, 7:24:18 AM4/8/13
to php-form-builder...@googlegroups.com
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

php-form-bu...@googlecode.com

unread,
Jun 20, 2013, 9:17:21 PM6/20/13
to php-form-builder...@googlegroups.com

Comment #1 on issue 198 by hamishro...@gmail.com: Error always appears
http://code.google.com/p/php-form-builder-class/issues/detail?id=198

I have the exact same issue. Did you find a solution to this?

php-form-bu...@googlecode.com

unread,
Jun 21, 2013, 8:44:22 AM6/21/13
to php-form-builder...@googlegroups.com

Comment #2 on issue 198 by animestr...@gmail.com: Error always appears
http://code.google.com/p/php-form-builder-class/issues/detail?id=198

Yep.. was mostly stupidity on my end

if (!empty($_POST)) {
//PFBC Code goes here
Reply all
Reply to author
Forward
0 new messages