A lot of new hacking methods are coming day by day. So it’s the programmers duty to make their user’s password secure. Here is a simple Password Strength Checker created using jQuery. The code contain a function got from WordPress (I modified it) which is the core component of the checker. This checker will check the following on the password :
- Have minimum value of 4 characters.
- Whether the username matches with password
- Whether the password contain small a-z characters and capital A-Z characters.
- Whether the password has numeric characters and special characters.
If all of the above criteria is matched, the checker will give a Strong Password message.
... [READ MORE]Create Your Own URL Shortening Service Using PHP & jQuery
Using Regex to validate E-mail and Phone Number
/^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/
/^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/
var emailregex=/^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/;var phoneregex=/^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;if (emailregex.test(string)){// valid email}else{// Invalid email}if (phoneregex.test(string)){// valid phone number}else{// Invalid phone number}
if (phoneregex.test($("#phone").val())){// valid phone number}else{// Invalid phone number}
... [READ MORE]