Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generation(m,n){cpt=n-m;zx=Math.random()*cpt;zxc=Math.floor(zx);return parseInt(m)+zxc}
- function generator(){
- var code=['1','q','2','e','E','3','4','r','5','t','6','y','7','8','9','0','p','a','s','d','f','g','h','k','l','ç','z','x','c','v','b','n','m'];
- ass=code[generation(1,16)];
- bss=code[generation(1,33)];
- css=code[generation(1,16)];
- dss=code[generation(1,33)];
- ess=code[generation(1,16)];
- fss=code[generation(0,33)];
- gss=code[generation(0,16)];
- hss=code[generation(0,33)];
- return ass+bss+css+dss+ess+fss+gss+hss;};function captcha(){
- a = generator();
- b = prompt('Digite o código captcha: '+a+'','');if(b==a){alert('Código captcha correto');return false}
- else{
- alert('Código captcha incorreto');if(!confirm('Quer tentar novamente?')){return false;};c = generator();d=prompt('Digite o código captcha: '+c+'','');function wrong(){captcha();};
- if(d==c){alert('Código captcha correto');return false;}
- else{alert('Código captcha incorreto');if(!confirm('Quer tentar novamente?')){return false;};wrong();};};};captcha();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement