Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.  <head>
  3.   <title> Password </title>
  4.    <script language="JavaScript">
  5.     function delete()
  6.      {
  7.        passw.value="";
  8.      }
  9.      
  10.      function inspas(pass)
  11.       {
  12.         var passgiusta="a1b2c3d",i;
  13.         var a=pass.length;
  14.        
  15.          if(a!=7)
  16.           {
  17.             alert("La password inserita non possiede 7 caratteri");
  18.             delete;
  19.            
  20.           }
  21.          else
  22.           {
  23.             for(i=2;i>0;i--)
  24.             {
  25.               if(pass==passgiusta)
  26.                {
  27.                  document.write("<p style='font-size:30; color:RGB(0,255,0);'> BRAVO");
  28.                  window.close();
  29.                  
  30.                }
  31.  
  32.               else
  33.                {
  34.                
  35.                    alert("sbagliato, ti rimangono:"+i "tentativi");
  36.                    delete;
  37.                  
  38.                 }
  39.              }
  40.                
  41.                 document.write("<p style=' font-size:30; color:RGB(255,0,0);'> SBAGLIATO!, la password corretta รจ:"+passgiusta);
  42.                
  43.            }
  44.  
  45.        
  46.  
  47.        }
  48.  
  49.    </script>
  50.   </head>
  51.   <body>
  52.   <p style="font-size:40; color:RGB(0,0,255);"> INSERIRE LA PASSWORD </p>
  53.   <p> <input type="text" name="passw" value="" size="30"> </p> <BR><BR>
  54.   <p> <input type="button" name="pulsA" value="verifica" onClick="inspas(passw.value);"></p>
  55.  </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement