Waarom laat dit script de text in de var $text niet zien?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
if ($_SESSION['Firstname'] && $_SESSION['Username'] && $_SESSION['Password']) {
$text = "
<b>
Ingelogd
</b>
Je bent al ingelogd!
";
}
else if (!$_SESSION['Firstname'] && $_SESSION['Username'] && $_SESSION['Password']) {
$mysql_username = "scriptznet_data";
$mysql_password = "scriptz";
$mysql_host = "hollosite.com";
$mysql_database = "scriptznet_data";
if (!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_username, $mysql_password))) {
$text = "
<b>
Fout
</b>
<br>
Geen database connectie!";
}
else {
$text = "
<b>
Log-in
</b>
<br>
<form action=\"$PHP_SEL\" method=\"post\">
Gebruikersnaam
<br>
<input type=\"text\" name=\"Username\">
<br>
<br>
Wachtwoord
<br>
<input type=\"password\" name=\"Password\">
<br>
<br>
<br>
<input type=\"submit\" name=\"Submit\" value=\"log-in\">
<br>
<input type=\"reset\" name=\"Reset\" value=\"wissen\">
</form>
";
if ($_POST['Submit']) {
if ($_POST['Username'] && $_POST['Password']) {
$select_members_details = "SELECT * FROM members WHERE Username = '$_POST[Username]' AND Password = '$_POST[Password]'";
$results_member_details = mysql_query($select_member_details);
if ($results_member_details == 1) {
while ($selected_member_details = mysql_fetch_array($results_member_details)) {
$text = "
<b>
Ingelogd
</b>
<br>
Je bent ingelogd, ".$selected_member_details['Firstname'].".
";
}
$_SESSION['Fistname'] = $selected_member_details['Firstname'];
$_SESSION['Username'] = $_POST['Username'];
$_SESSION['Password'] = md5($_POST['Password']);
}
else {
$text = "
<b>
Fout
</b>
<br>
Het wachtwoord en/of de gebruikersnaam zijn ongeldig!
";
}
}
else {
$text = "
<b>
Fout
</b>
<br>
Je hebt iets niet ingevuld!
";
}
}
}
}
echo "".$text."";
?>
if ($_SESSION['Firstname'] && $_SESSION['Username'] && $_SESSION['Password']) {
$text = "
<b>
Ingelogd
</b>
Je bent al ingelogd!
";
}
else if (!$_SESSION['Firstname'] && $_SESSION['Username'] && $_SESSION['Password']) {
$mysql_username = "scriptznet_data";
$mysql_password = "scriptz";
$mysql_host = "hollosite.com";
$mysql_database = "scriptznet_data";
if (!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_username, $mysql_password))) {
$text = "
<b>
Fout
</b>
<br>
Geen database connectie!";
}
else {
$text = "
<b>
Log-in
</b>
<br>
<form action=\"$PHP_SEL\" method=\"post\">
Gebruikersnaam
<br>
<input type=\"text\" name=\"Username\">
<br>
<br>
Wachtwoord
<br>
<input type=\"password\" name=\"Password\">
<br>
<br>
<br>
<input type=\"submit\" name=\"Submit\" value=\"log-in\">
<br>
<input type=\"reset\" name=\"Reset\" value=\"wissen\">
</form>
";
if ($_POST['Submit']) {
if ($_POST['Username'] && $_POST['Password']) {
$select_members_details = "SELECT * FROM members WHERE Username = '$_POST[Username]' AND Password = '$_POST[Password]'";
$results_member_details = mysql_query($select_member_details);
if ($results_member_details == 1) {
while ($selected_member_details = mysql_fetch_array($results_member_details)) {
$text = "
<b>
Ingelogd
</b>
<br>
Je bent ingelogd, ".$selected_member_details['Firstname'].".
";
}
$_SESSION['Fistname'] = $selected_member_details['Firstname'];
$_SESSION['Username'] = $_POST['Username'];
$_SESSION['Password'] = md5($_POST['Password']);
}
else {
$text = "
<b>
Fout
</b>
<br>
Het wachtwoord en/of de gebruikersnaam zijn ongeldig!
";
}
}
else {
$text = "
<b>
Fout
</b>
<br>
Je hebt iets niet ingevuld!
";
}
}
}
}
echo "".$text."";
?>
Firstname moet leeg zijn en in de andere session-vars moet iets staan?