How to put this java script into HTML?

kingz

New member
I have a script here, I would like to know how to do several things:

1. whats wrong with it and how do i fix it (in java).
2. how to put it in html.
3. how to encrypt the password.
4. any tips on how to make the script better/more secure.
5. if it is possible i would like my html script to open up the dialog box saying: password: ... before i even get to see the webpage.
6. and just if you happen to know, how would i do something similar (password required to open) with opening up any document/folders on my computer (windows 7)
tyvm...

import static java.lang.System.out;
import java.util.Scanner;

class Authenticator {
public static void main(String args[] {

Scanner myScanner = new Scanner(System.in);

out.print("Username: ");
String password = myScanner.next();

out.print("password: ");
String password = myScanner.next();

if (
(username.equals("bird") &&
password.equals("swordfish")) ||
(username.equals("shark") &&
password.equals("dog"))
)
{
out.println(You're in.");
} else {
out.println("Your're suspicious.");
}
}
}
 
Back
Top