Tuesday, April 11, 2017

Jquery Validate, Form and tbody

The order of tbody, td, form and table, if they are not in order, it might not work.
===================================================================
<html>
<head>
  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
  <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script>

$(function(){

    $("#changePWDForm").validate({
        rules:{
            currentPwd: "required",
            newPwd:{
                required:true,
                minlength: 8
            },
            checkPwd:{
                required:true,
                minlength: 8
            },
        },
        messages:{
                currentPwd: "Please enter your current password.",
                newPwd: {
                        required: "Please enter your new password.",
                        minlength: "Your password must be at least 8 characters long"
                        },
                checkPwd: {
                        required: "Please enter your new password.",
                        minlength: "Your password must be at least 8 characters long"
                        },
                }
    });

        $(document).on('click', "#submitChange", function (e) {
alert('A');

    });
});


</script>
</head>
<body>
<table border=0 id="embededLoginTable" class="outLineTable">
  <tr>
      <tbody id="oraPWDDiv">
    <td align="center">
        <form id="changePWDForm" method="post" class="ora_form" action="#">
          <table border=0 class="centreTable">
          <fieldset>
          <tr>
            <td><userLable><userLable>Current Password:</userLable></td><td><input type="password" name="currentPwd" id="currentPwd" class="ora_pwd"/></td>
          </tr>
          <tr>
            <td><userLable>New Password:</userLable></td><td><input type="password" name="newPwd" id="newPwd" class="ora_pwd" /></td>
          </tr>
          <tr>
            <td><userLable>Confirm New Password:</userLable></td>
            <td><input type="password" name="checkPwd" id="checkPwd" class="ora_pwd"/> </td>
          </tr>
          <tr>
            <td align="right"><input type="submit" name="submit" value="Change Password" id="submitChange" /></td>
            <td align="left"><input type="reset" name="reset" value="Reset" id="resetinputs" /></td>
          </tr>
          </fieldset>
          </table>
        </form>
    </td>
      </tbody>
  </tr>
  <tr>
    <td align="center">
      <div id="messageDiv" class="mssgDiv"><md></md> </div>
    </td>
  </tr>
</table>


</body>
</html>

Wednesday, April 5, 2017

PHP oci_connect: ORA-01017: invalid username/password; logon denied

Symptom:

In browser, user click button to search Oracle Database by the username typed in input field. It works once, then complain:ORA-01017: invalid username/password; logon denied , click again it works, if click again, it pops up the error message again.

What I did:

1. Double quoted the connection password (in wallet in my case.)
2. creating a file called "20-oci8.ini" in directory "/etc/php.d" with the following content.

; Enable oci8 extension module
extension=oci8.so
3. Disable the extension=oci8.so in /etc/php.ini