With the last version of PHP, there are many actual methods included in the core language that you should use in your code files. These will help you a lot that you might have working out the easist way to creat a salt. So, if you are able to do, I suggest you to switch to using this method everywhere (if possible) you generate passwords.

Hashing Logic is as simple as you doing this:

password_hash('YouRSuperSecure&(*$p880$0w0rd!', PASSWORD_BCRYPT);

Here, you pass in the string that you want to hash, and the method of hashing that you’re looking to use. You can add the second parameter, and stick to the default that PHP chooses to the best.

By default the method will use a cost of 10, which is a good level to start at, however if you want to change this, you can pass through the cost as a third parameter as an array of options.

See below example sets the cost value to 16 (min is 4, max is 30)

Example:- 

password_hash('YouRSuperSecure&(*$p880$0w0rd!', PASSWORD_BCRYPT, ['cost' => 16]);


It’s just that easy like anything! Enjoy!. 

Please do share our blog with interested coders and those you always ready to learn. 

Hashing Passwords with PHP Coding

Sangwan Pankaj Reply 02:50

With the last version of PHP, there are many actual methods included in the core language that you should use in your code files. These wil...

Access to plugin and theme code is available in the WordPress dashboard. You can do one thing to protect the site from trifile to disable the both of these editors. Open your wp-config.php file and add the following constant:

define('DISALLOW_FILE_EDIT',true);

Now, when you are in the dashboard it is impossible to access the theme or plugin editor, even if you are admin.

Disable the Plugin and Theme Editor

Sangwan Pankaj Reply 12:57

Access to plugin and theme code is available in the WordPress dashboard. You can do one thing to protect the site from trifile to disable t...

you can try this to redirect your own url when clicking browser back button


<script>
jQuery(document).ready(function($) {

      if (window.history && window.history.pushState) {

        $(window).on('popstate', function() {
          var hashLocation = location.hash;
          var hashSplit = hashLocation.split("#!/");
          var hashName = hashSplit[1];

          if (hashName !== '') {
            var hash = window.location.hash;
            if (hash === '') {
              alert('Back button was pressed.');
                window.location='www.yourweburlhere.com';
                return false;
            }
          }
        });

        window.history.pushState('forward', null, './#forward');
      }

    });
</script>

Redirect to another url when back button is clicked using javascript

Jimmy Wales Reply 17:02

you can try this to redirect your own url when clicking browser back button <script> jQuery ( document ). ready ( function ( $ ) ...

You need to test for the negation of the Regular Expressions because you want the validation to alert upon failure,

(is_valid = !/^[0-9]+$/.test(x))
Example :-

<form action="" method="POST" name="cdp_form" id="cdp_form">
<input type="text" id="phone_number" name="phone_number" placeholder="Enter your phone number" maxlength="10" onkeyup="validateForm()">
<button type="submit" name="SEND" class="btn btn-brown">Send</button>
</form>
<?php echo $successmsg; ?>
<script>
//form validation
function validateForm()
{
var x=document.forms["cdp_form"]["phone_number"].value
if (x==null || x=="")
  {
  alert("Phone number  field must be filled in");
  cdp_form.phone_number.focus();
  return false;
  }
else if (is_valid = !/^[0-9]+$/.test(x))
    {
    alert("Phone number field must have numeric characters");
    cdp_form.phone_number.focus();
    return false;
  }
}
</script>

Form validation of numeric characters

Jimmy Wales Reply 15:20

You need to test for the negation of the Regular Expressions because you want the validation to alert upon failure, (is_valid = !/^[0-9]+$...

Copyright by GhostPHP. Powered by Blogger.

Search

Recent Post

Popular Posts

Follow us