第一步
將如下代碼加入HTML的〈BODY〉區
<script LANGUAGE=
<!
flag=
flag
</script>
<script LANGUAGE=
</script>
<script LANGUAGE=
</script>
<h
<script LANGUAGE=
<!
function main()
{
member = document
pass = document
encryption()
password()
}
</script>
<p>輸入用戶名: <input TYPE=
請輸入密碼: <input TYPE=
<input TYPE=
第二步
文件
一張密碼表
function encryption()
{
mm =
k =
b =
mmmm =
ccc =
l =
c =
m =
abcd =
o =
u =
e =
gg =
p =
jj =
v =
j =
x =
r =
bb =
cc =
z =
a =
ee =
n =
ff =
i =
w =
ii =
kk =
q =
oooo =
d =
nn =
oo =
pp =
t =
s =
rr =
ss =
tt =
uu =
h =
vv =
ww =
aa =
xx =
hh =
yy =
zz =
y =
qq =
aaa =
bbb =
f =
ddd =
eee =
fff =
dd =
ggg =
hhh =
iii =
jjj =
kkk =
lll =
mmm =
nnn =
ooo =
ppp =
qqq =
rrr =
sss =
ttt =
uuu =
vvv =
www =
xxx =
yyy =
zzz =
aaaa =
bbbb =
cccc =
g =
dddd =
eeee =
ffff =
gggg =
hhhh =
iiii =
jjjj =
kkkk =
llll =
nnnn =
}
文件
function password()
{
if(member==i+p+d+m+y) //第一個用戶名
{
if(pass==hhh+iii+fff+ggg) //第一個密碼
{
alert(
window
flag
}
}
if(member==k+v+j) //設定第二個用戶名
{
if(pass==f+i+p+d)
{
alert(
window
flag
}
}
if(member==qqq+llll+ttt+llll+rrr) //設定第三個用戶名
{
if(pass==ooo+sss+oooo)
{
alert(
window
flag
}
}
if(member==
{
}
else
{
if(flag==
{
window
flag
}
if(flag
else
{
alert (
flag=flag+
}
}
}
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19629.html