$opwdErr = "Old password required!";
    } else {
        //old password entered
        if (!Utilisateur::PasswordMatches($login, $_POST["opwd"])) {
            // but not correct
            $opwdErr = "Old password doesn't match!";
        } else {
            //old password is correct
            $opwd = $_POST["opwd"];
            if (empty($_POST["pwd"]) || empty($_POST["cpwd"])) {
                $pwd = $opwd;
            }
        }
    }
    if ($loginErr == "" && $nameErr == "" && $lnameErr == "" && $emailErr == "" && $opwdErr == "" && $pwdErr == "" && $cpwdErr == "" && $bdateErr == "") {
        updating($login, $pwd);
        echo "<script type=\"text/javascript\">";
        echo "alert(\"Changes made!\");";
        echo "</script>";
    } else {
        echo "<script type=\"text/javascript\">";
        echo "alert(\"There's an error!\");";
        echo "</script>";
    }
}
?>
        
    <div class="row">
        <div class="col-md-8 col-md-offset-2 aboutus"> 
            <form action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]) . "?page=editprofile";
示例#2
0
文件: ajax.php 项目: vyserees/mobile
 public function updateOrder()
 {
     $post = filter_input_array(INPUT_POST);
     if ($post['key'] === 'paid') {
         updating('orders', array('ord_id' => $post['val']), array('ord_id' => $post['val'], 'ord_paid' => 'C'));
         echo '<p style="padding:7px 12px;background:#5cb85c;color:#fff;margin:0;text-align:center;">UPLATA POTVRDJENA</p>';
     } elseif ($post['key'] === 'status') {
         updating('orders', array('ord_id' => $post['val']), array('ord_id' => $post['val'], 'ord_status' => 'C'));
         echo '<p style="padding:7px 12px;background:#5cb85c;color:#fff;margin:0;text-align:center;">REALIZACIJA POTVRDJENA</p>';
     } elseif ($post['key'] === 'delete') {
         deleting('orders', array('ord_id' => $post['val']));
         deleting('orderlist', array('oli_order_id' => $post['val']));
     }
 }