It's a javascript mini script/program I made. When clicking a particular photo prompts you to enter the password to redirect you to a new page, but the function of length finds a bug when clicking cancel. Any ideas? It's the following script : (I took off the image) Also the password is contained in a variable, because i had it in js format in cgi-bin, because this way it can be read only by the browser.
function pass() {
var vs = window.prompt("PASSWORD TO EDIT :","XXXXXX")
var ls = vs.length
if (ls >= 5) {
}
else {
alert("ERROR 1 : The password must be over 5 characters long.")
}
if (ls == 0) {
alert("ERROR 2 : NULL OBJECT")
}
var vssnull = ""
var vssnull2 = " "
var ss = "12369*"
//PASSWORD
var vssnull3 = "XXXXXX"
if (vs == null) {
alert("ERROR 3 : NO PASSWORD INSERTED")
}
if (vs == vssnull) {
alert("ERROR 3 : NO PASSWORD INSERTED")
}
if (vs == vssnull2) {
alert("ERROR 3 : NO PASSWORD INSERTED")
}
if (vs == vssnull3) {
alert("ERROR 3 : NO PASSWORD INSERTED")
}
if (vs == ss) {
window.location = "http://i-plus.enosi.org/cgi-bin/util/fm_nmp"
}
else {
alert("ERROR 4 : INVALID PASSWORD")
}
}