0
로그인 정보로 사이트를 만들고 있습니다. 사용자 이름/비밀번호는 웹 사이트 파일에 .txt로 저장됩니다. (나는 안전하지 않다는 것을 안다. 이것은 안전하지 않다. 사람들이 패스워드 중 하나를 크랙 할 수 있는지 테스트하는 것이다.) 당신이 입력 한 사용자 이름, usernames.txt에서 사용자 이름과 같다면 확인 있도록 .txt에서 사용자 이름/비밀번호를 가져 오는 방법 Javascript
var attempt = 3;
function validate(){
\t var username = document.getElementById("username").value;
\t var password = document.getElementById("password").value;
\t if (username == "username" || username == "Username" && password == "B6YC98"){
\t \t window.location = "success.html";
\t \t return false;
\t }
\t else{
\t \t attempt --;
\t \t alert("You have "+attempt+" attempt(s) left;");
\t \t
\t \t if(attempt == 0){
\t \t \t document.getElementById("username").disabled = true;
\t \t \t document.getElementById("password").disabled = true;
\t \t \t document.getElementById("submit").disabled = true;
\t \t \t return false;
\t \t }
\t }
}
감사합니다. 그리고 아니, 그들이 그렇게해도 상관 없습니다. 나는 이것을 의도적으로 사람들을 시험하기 위해 만들고 있습니다. –