Parse error: syntax error, unexpected '{'
Ik heb een probleem in een script, en ik krijg het niet goed. dus misschien dat hier iemand mij kan helpen.
De error die ik krijg is:
Parse error: syntax error, unexpected '{' in C:\Users\Jurre\Desktop\USB\root\include\_include.php on line 83
Script
Quote:
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
session_start();
ob_start();
include('_config.php');
if(isset($_COOKIE['gebruikersid']) AND isset($_COOKIE['waarde']))
{
$sql=mysql_query("SELECT * FROM users WHERE id='".$_COOKIE['gebruikersid']."'");
$fetch=mysql_fetch_assoc($sql);
$gebruiker = $fetch['user'];
$wachtwoord = md5($fetch['pass']);
if($wachtwoord == $_COOKIE['waarde'])
{
$_SESSION['user'] = $fetch['user'];
$_SESSION['userid'] = $_COOKIE['gebruikersid'];
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
}
else
{
setcookie('gebruikersid', "", time() - 60 * 60 * 24 * 365);
setcookie('waarde', "", time() - 60 * 60 * 24 * 365);
session_destroy();
echo "<meta http-equiv=\"refresh\" content=\"0;url=/index.php\" />";
}
}
function check_login()
{
if(empty($_SESSION['user']) || empty($_SESSION['ip']))
{
echo 'Je bent niet ingelogd. ';
echo "<a href='/inloggen.php'>Klik hier</a> om je in te loggen";
include('footer.php');
die();
}
if($_SESSION['ip'] != $_SERVER['REMOTE_ADDR'])
{
echo 'Je bent niet ingelogd. ';
echo "<a href='/inloggen.php'>Klik hier</a> om je in te loggen";
include('footer.php');
die();
}
$sql = "SELECT * FROM `users` WHERE `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) == null)
{
echo 'Je bent niet ingelogd. ';
echo "<a href='/inloggen.php'>Klik hier</a> om je in te loggen";
include('footer.php');
die();
}
}
function login()
{
if(isset($_SESSION['user']) && isset($_SESSION['ip']))
{
if(!empty($_SESSION['user']) && !empty($_SESSION['ip']))
{
if($_SESSION['ip'] == $_SERVER['REMOTE_ADDR'])
{
$sql = "SELECT * FROM `users` WHERE `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) != null)
{
return '1';
}
}
}
}
return '0';
}
function admin()
{
if(isset($_SESSION['user']))
{
if(!empty($_SESSION['user'])
{
$sql = "SELECT * FROM `users` WHERE `level`='10' AND `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) != null)
{
return '1';
}
}
}
return '0';
}
function check_admin()
{
if(isset($_SESSION['user']))
{
if(!empty($_SESSION['user'])
{
$sql = "SELECT * FROM `users` WHERE `level`='10' AND `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) == null)
{
echo 'Je bent geen admin! ';
include('footer.php');
die();
}
}
}
}
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT * FROM verbannen WHERE ip='".$ip."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) != null)
{
header('Location: /verbannen.php');
}
?>
session_start();
ob_start();
include('_config.php');
if(isset($_COOKIE['gebruikersid']) AND isset($_COOKIE['waarde']))
{
$sql=mysql_query("SELECT * FROM users WHERE id='".$_COOKIE['gebruikersid']."'");
$fetch=mysql_fetch_assoc($sql);
$gebruiker = $fetch['user'];
$wachtwoord = md5($fetch['pass']);
if($wachtwoord == $_COOKIE['waarde'])
{
$_SESSION['user'] = $fetch['user'];
$_SESSION['userid'] = $_COOKIE['gebruikersid'];
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
}
else
{
setcookie('gebruikersid', "", time() - 60 * 60 * 24 * 365);
setcookie('waarde', "", time() - 60 * 60 * 24 * 365);
session_destroy();
echo "<meta http-equiv=\"refresh\" content=\"0;url=/index.php\" />";
}
}
function check_login()
{
if(empty($_SESSION['user']) || empty($_SESSION['ip']))
{
echo 'Je bent niet ingelogd. ';
echo "<a href='/inloggen.php'>Klik hier</a> om je in te loggen";
include('footer.php');
die();
}
if($_SESSION['ip'] != $_SERVER['REMOTE_ADDR'])
{
echo 'Je bent niet ingelogd. ';
echo "<a href='/inloggen.php'>Klik hier</a> om je in te loggen";
include('footer.php');
die();
}
$sql = "SELECT * FROM `users` WHERE `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) == null)
{
echo 'Je bent niet ingelogd. ';
echo "<a href='/inloggen.php'>Klik hier</a> om je in te loggen";
include('footer.php');
die();
}
}
function login()
{
if(isset($_SESSION['user']) && isset($_SESSION['ip']))
{
if(!empty($_SESSION['user']) && !empty($_SESSION['ip']))
{
if($_SESSION['ip'] == $_SERVER['REMOTE_ADDR'])
{
$sql = "SELECT * FROM `users` WHERE `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) != null)
{
return '1';
}
}
}
}
return '0';
}
function admin()
{
if(isset($_SESSION['user']))
{
if(!empty($_SESSION['user'])
{
$sql = "SELECT * FROM `users` WHERE `level`='10' AND `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) != null)
{
return '1';
}
}
}
return '0';
}
function check_admin()
{
if(isset($_SESSION['user']))
{
if(!empty($_SESSION['user'])
{
$sql = "SELECT * FROM `users` WHERE `level`='10' AND `user`='".$_SESSION['user']."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) == null)
{
echo 'Je bent geen admin! ';
include('footer.php');
die();
}
}
}
}
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "SELECT * FROM verbannen WHERE ip='".$ip."'";
$res = mysql_query($sql);
if(mysql_num_rows($res) != null)
{
header('Location: /verbannen.php');
}
?>
Je mist een ) op regel 82, dat had je zelf ook kunnen constateren aan de hand van de foutmelding.
Je sluit empty niet af met een ) op regel 82 en ook op regel 100
Heb er denk ik overheen gelezen.