Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Validate confirm password while typing
- $(document).ready(function()
- {
- $("#cpassword").keyup(function()
- {
- var cpassword = $(this).val();
- if (cpassword.length > 0)
- {
- $("#resultcpass").html('<i class="fa fa-circle-o-notch fa-spin loading-icon"></i>');
- /*$.post("email-check.php", $("#reg-form").serialize())
- .done(function(data){
- $("#resultmail").html(data);
- });*/
- $.ajax({
- type : 'POST',
- url : 'cpassword-check.php',
- data : {
- $(this).serialize(),
- $('#password').serialize()
- },
- success : function(data)
- {
- $("#resultcpass").html(data);
- }
- });
- return false;
- }
- else
- {
- $("#resultcpass").html('');
- }
- });
- });
- <?php
- $host="localhost";
- $user="root";
- $pass="";
- $dbname="lr";
- $dbcon = new PDO("mysql:host={$host};dbname={$dbname}",$user,$pass);
- if($_POST['cpassword'])
- {
- $cpassword = strip_tags($_POST['cpassword']);
- $password = strip_tags($_POST['password']);
- if ( $cpassword != $password ){
- echo "<i class='fa fa-circle user-validation-w pull-right' aria-hidden='true'></i><span class='availability pull-right'> Must match with password</span>";
- } else {
- echo "<i class='fa fa-check user-validation-ok pull-right' aria-hidden='true'></i><span class='availability pull-right'></span>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement