Professional Documents
Culture Documents
$userVerified = 0;
51
52
53
// and password
54
while ( !feof(
loop, variable
Function$userVerified
fgets reads a line
from
is set
to 0the
. text file.
$file
) && !$userVerified
) {
The result
is assigned to variable
$line.
55
56
57
58
59
60
61
62
63
password.php
(3 of 7)
64
65
// verify username
66
if ( $USERNAME == $field[ 0 ] ) {
67
$userVerified = 1;
68
69
function
// call function checkPassword to If
verify
70
// users password
71
permission
if ( checkPassword( $PASSWORD, $field
)
72
== true )
73
accessGranted( $USERNAME );
74
75
else
wrongPassword();
76
77
78
81
82
83
84
if ( !$userVerified )
85
accessDenied();
79
80
86
87
88
89
90
{
if ( $userpassword == $filedata[ 1 ] )
91
return true;
92
else
93
return false;
94
95
96
97
98
99
{
print( "<title>Thank You</title></head>
100
101
102
font-size: 1em;
103
104
105
106
password.php
(5 of 7)
107
108
109
110
111
{
print( "<title>Thank You</title></head>
112
113
114
115
116
117
118
119
120
121
function wrongPassword()
122
125
126
127
128
been denied.</strong>" );
123
124
129
130
131
132
function accessDenied()
133
{
print( "<title>Access Denied</title></head>
134
135
136
137
<strong>
138
139
<br /></strong>" );
140
141
1
4
2
/
/p
r
i
n
t am
e
s
s
a
g
ei
n
d
i
c
a
t
i
n
gt
h
a
tf
i
e
l
d
s
1
4
3
/
/h
a
v
eb
e
e
nl
e
f
tb
l
a
n
k
1
4
4
f
u
n
c
t
i
o
nf
i
e
l
d
s
B
l
a
n
k
(
)
1
4
5
1
4
6
1
4
7
1
4
8
f
o
n
t
s
i
z
e
:1
e
m
;c
o
l
o
r
:r
e
d
\
"
>
1
4
9
<
s
t
r
o
n
g
>
1
5
0
P
l
e
a
s
ef
i
l
li
na
l
lf
o
r
mf
i
e
l
d
s
.
1
5
1
<
b
r/
>
<
/
s
t
r
o
n
g
>
")
;
}
1
5
2
1
5
3
1
5
4
?
>
<
/
b
o
d
y
>
1
5
5<
/
h
t
m
l
>
1a
c
c
o
u
n
t
1
,
p
a
s
s
w
o
r
d
1
2a
c
c
o
u
n
t
2
,
p
a
s
s
w
o
r
d
2
3a
c
c
o
u
n
t
3
,
p
a
s
s
w
o
r
d
3
4a
c
c
o
u
n
t
4
,
p
a
s
s
w
o
r
d
4
5a
c
c
o
u
n
t
5
,
p
a
s
s
w
o
r
d
5
6a
c
c
o
u
n
t
6
,
p
a
s
s
w
o
r
d
6
password.txt
(1 of 1)
7a
c
c
o
u
n
t
7
,
p
a
s
s
w
o
r
d
7
8a
c
c
o
u
n
t
8
,
p
a
s
s
w
o
r
d
8
9a
c
c
o
u
n
t
9
,
p
a
s
s
w
o
r
d
9
1
0a
c
c
o
u
n
t
1
0
,
p
a
s
s
w
o
r
d
1
0
Databases
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4 <!-- Fig. 26.18: data.html
-->
data.html
(1 of 2)
<head>
<title>Sample Database Query</title>
</head>
11
12
13
14
15
16
17
18
19
20
21
-->
<
s
e
l
e
c
tn
a
m
e= "
s
e
l
e
c
t
"
>
22
23
<
o
p
t
i
o
ns
e
l
e
c
t
e
d= "
s
e
l
e
c
t
e
d
"
>
*
<
/
o
p
t
i
o
n
>
24
<
o
p
t
i
o
n
>
I
D
<
/
o
p
t
i
o
n
>
25
<
o
p
t
i
o
n
>
T
i
t
l
e
<
/
o
p
t
i
o
n
>
26
<
o
p
t
i
o
n
>
C
a
t
e
g
o
r
y
<
/
o
p
t
i
o
n
>
27
<
o
p
t
i
o
n
>
I
S
B
N
<
/
o
p
t
i
o
n
>
<
/
s
e
l
e
c
t
>
28
<
/
p
>
29
30
<
i
n
p
u
tt
y
p
e="
s
u
b
m
i
t
"v
a
l
u
e="
S
e
n
dQ
u
e
r
y
"
31
32
s
t
y
l
e= "
b
a
c
k
g
r
o
u
n
d
c
o
l
o
r
:b
l
u
e
;
33
c
o
l
o
r
:y
e
l
l
o
w
;f
o
n
t
w
e
i
g
h
t
:b
o
l
d
"/
>
34
35
<
/
f
o
r
m
>
<
/
b
o
d
y
>
36 <
/
h
t
m
l
>
10
11
SQL
mysql_connect
mysql_select_db
mysql_query
mysql_error
mysql_fetch_row
mysql_close
12