<head>
[removed]
function login() {
if (index != -1) alert("현재 로그인 상태입니다! ");
else {
var uName = document.getElementById("name");
var uPw = document.getElementById("pw");
for ( var i in stu) {
if (stu[i].name == uName.value) {
cName=true;
if (stu[i].password == uPw.value) {
cPw = true;
index = i;
}
}
}
if (!cName) {
alert("수강생 이름을 다시 확인해 주세요.!");
uName.value=""; uPw.value = "";
}
else if ( !cPw) {
alert("패스워드를 다시 확인해 주세요 !");
uPw.value= "" ;
}
else { alert("사용자님의 로그-인을 확인했습니다 !");
uName.value="******";
uPw.value= "******" ;
}
}
}
[removed]
</head>
<body>
웹프로그래밍1 성적조회 시스템
이름 <input id="name" type="text" /> 비밀번호 <input id="pw" type="password" />
<input type="button" value="Log-In" onclick="login()" />
<input type="button" value="Log-Out" onclick="logout()" />
<input type="button" value="개별성적 조회" onclick="retrieval1()" />
<input type="button" value="전체성적 조회" />
<textarea id="output" cols="70" rows="15" text =""> </textarea>
</body>
이거 로그인이 안되는데 뭐가 문제일까 형들<%2
cName하고 cPw는 login()밖에 선언되어 있나요?