PHP Parse error: syntax error, unexpected end of file
Heb gekeken of alle haakjes kloppen (openen en sluiten), maar zie door de bomen het bos niet meer.
Error treedt op op laatste regel.
In error.log van Apache: PHP Parse error: syntax error, unexpected end of file in /var/www/html/sources/d-lite.php on line 106
Code is als volgt:
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
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
<?php @session_start();
$_SESSION['GoFrame'] = "ready";
$FullSite_URL = "http://$Site_URL";
$FullPath = $Path;
$UpdateInterval = ($Interval . '000');
$UpdateIntervalRot = ($IntervalRot . '000');
if ($draggable == "yes")
{
?>
<script>
$(function() {
$("#nowPlaying").draggable({ distance: 10, opacity: 0.35 });
$("#Logo").draggable({ distance: 10, opacity: 0.35 });
$("#Contact").draggable({ distance: 10, opacity: 0.35 });
$("#Lastplayed").draggable({ distance: 10, opacity: 0.35 });
$("#requestform").draggable({ distance: 10, opacity: 0.35 });
$("#schedule").draggable({ distance: 10, opacity: 0.35 });
});
</script>
<?
}
if (!$ProxyAuth)
{
$_SESSION['ProxyAuth'] = null;
}
else
{
$_SESSION['ProxyAuth'] = $ProxyAuth;
}
$Proxy = $ProxyAddress . ':' . $ProxyPort;
$_SESSION['username'] =$username;
$_SESSION['userpass'] =$userpass;
$_SESSION['Site_URL'] =$Site_URL;
$_SESSION['FullSite_URL'] =$FullSite_URL;
$_SESSION['FullPath'] =$FullPath;
$_SESSION['NowPlayingSource'] =$NowPlayingSource;
$_SESSION['NowPlaying_Method'] =$NowPlaying_Method;
$_SESSION['NowPlayingType'] =$NowPlayingType;
$_SESSION['LastPlayed_Method'] =$LastPlayed_Method;
$_SESSION['SongChangeEffect'] =$SongChangeEffect;
$_SESSION['ArtistTitleSplit'] =$ArtistTitleSplit;
$_SESSION['smalparenthesis'] =$smalparenthesis;
$_SESSION['Background_Type'] =$Background_Type;
$_SESSION['FadeTo'] =$FadeTo;
$_SESSION['NowPlayingCase'] =$NowPlayingCase;
$_SESSION['StandardBackground'] =$StandardBackground;
$_SESSION['ServerType'] =$ServerType;
$_SESSION['ServerAddress'] =$ServerAddress;
$_SESSION['ServerPort'] =$ServerPort;
$_SESSION['ServerVersion'] =$ServerVersion;
$_SESSION['ShoutcastID'] =$ShoutcastID;
$_SESSION['MountPoint'] =$MountPoint;
$_SESSION['altServerType'] =$altServerType;
$_SESSION['altServerAddress'] =$altServerAddress;
$_SESSION['altServerPort'] =$altServerPort;
$_SESSION['altServerVersion'] =$altServerVersion;
$_SESSION['altShoutcastID'] =$altShoutcastID;
$_SESSION['altNowPlaying_Method'] =$altNowPlaying_Method;
$_SESSION['altMountPoint'] =$altMountPoint;
$_SESSION['httpAddress'] =$httpAddress;
$_SESSION['httpPort'] =$httpPort;
$_SESSION['GetPath'] =$GetPath;
$_SESSION['LastPlayed_Type'] =$LastPlayed_Type;
$_SESSION['LastPlayed_Header'] =$LastPlayed_Header;
$_SESSION['LastPlayed_Line'] =$LastPlayed_Line;
$_SESSION['NowPlaying_Ignore'] =$NowPlaying_Ignore;
$_SESSION['LP_httpAddress'] =$LP_httpAddress;
$_SESSION['LP_httpPort'] =$LP_httpPort;
$_SESSION['LP_GetPath'] =$LP_GetPath;
$_SESSION['UseProxy'] =$UseProxy;
$_SESSION['proxy'] =$Proxy;
$_SESSION['OnSetChange'] =$OnSetChange;
$_SESSION['FileGetMethod'] =$FileGetMethod;
$root_folder = basename($_SERVER['REQUEST_URI']);
if(substr($root_folder, -4) == '.php')
{
$root_folder = basename(dirname($_SERVER['REQUEST_URI']));
}
switch ($root_folder)
{
case "0": $DirectLink="0"; break;
case "home": $DirectLink="1"; break;
case "aanvragen": $DirectLink="2"; break;
case "laatstgedraaid": $DirectLink="3"; break;
case "contact": $DirectLink="4"; break;
case "admin": $DirectLink="5"; break;
default: $DirectLink="1";
}
if (isset($DirectLink))
{
$stdHomeContent = $DirectLink;
}
?>
<script>
$((document).ready(function() {
$('#container').Tabs({defaultContent:<?php echo $stdHomeContent;?>});
$('a.ILinkIt').click(function(){
window.open(this.href);
return false;
});
}));
</script>
$_SESSION['GoFrame'] = "ready";
$FullSite_URL = "http://$Site_URL";
$FullPath = $Path;
$UpdateInterval = ($Interval . '000');
$UpdateIntervalRot = ($IntervalRot . '000');
if ($draggable == "yes")
{
?>
<script>
$(function() {
$("#nowPlaying").draggable({ distance: 10, opacity: 0.35 });
$("#Logo").draggable({ distance: 10, opacity: 0.35 });
$("#Contact").draggable({ distance: 10, opacity: 0.35 });
$("#Lastplayed").draggable({ distance: 10, opacity: 0.35 });
$("#requestform").draggable({ distance: 10, opacity: 0.35 });
$("#schedule").draggable({ distance: 10, opacity: 0.35 });
});
</script>
<?
}
if (!$ProxyAuth)
{
$_SESSION['ProxyAuth'] = null;
}
else
{
$_SESSION['ProxyAuth'] = $ProxyAuth;
}
$Proxy = $ProxyAddress . ':' . $ProxyPort;
$_SESSION['username'] =$username;
$_SESSION['userpass'] =$userpass;
$_SESSION['Site_URL'] =$Site_URL;
$_SESSION['FullSite_URL'] =$FullSite_URL;
$_SESSION['FullPath'] =$FullPath;
$_SESSION['NowPlayingSource'] =$NowPlayingSource;
$_SESSION['NowPlaying_Method'] =$NowPlaying_Method;
$_SESSION['NowPlayingType'] =$NowPlayingType;
$_SESSION['LastPlayed_Method'] =$LastPlayed_Method;
$_SESSION['SongChangeEffect'] =$SongChangeEffect;
$_SESSION['ArtistTitleSplit'] =$ArtistTitleSplit;
$_SESSION['smalparenthesis'] =$smalparenthesis;
$_SESSION['Background_Type'] =$Background_Type;
$_SESSION['FadeTo'] =$FadeTo;
$_SESSION['NowPlayingCase'] =$NowPlayingCase;
$_SESSION['StandardBackground'] =$StandardBackground;
$_SESSION['ServerType'] =$ServerType;
$_SESSION['ServerAddress'] =$ServerAddress;
$_SESSION['ServerPort'] =$ServerPort;
$_SESSION['ServerVersion'] =$ServerVersion;
$_SESSION['ShoutcastID'] =$ShoutcastID;
$_SESSION['MountPoint'] =$MountPoint;
$_SESSION['altServerType'] =$altServerType;
$_SESSION['altServerAddress'] =$altServerAddress;
$_SESSION['altServerPort'] =$altServerPort;
$_SESSION['altServerVersion'] =$altServerVersion;
$_SESSION['altShoutcastID'] =$altShoutcastID;
$_SESSION['altNowPlaying_Method'] =$altNowPlaying_Method;
$_SESSION['altMountPoint'] =$altMountPoint;
$_SESSION['httpAddress'] =$httpAddress;
$_SESSION['httpPort'] =$httpPort;
$_SESSION['GetPath'] =$GetPath;
$_SESSION['LastPlayed_Type'] =$LastPlayed_Type;
$_SESSION['LastPlayed_Header'] =$LastPlayed_Header;
$_SESSION['LastPlayed_Line'] =$LastPlayed_Line;
$_SESSION['NowPlaying_Ignore'] =$NowPlaying_Ignore;
$_SESSION['LP_httpAddress'] =$LP_httpAddress;
$_SESSION['LP_httpPort'] =$LP_httpPort;
$_SESSION['LP_GetPath'] =$LP_GetPath;
$_SESSION['UseProxy'] =$UseProxy;
$_SESSION['proxy'] =$Proxy;
$_SESSION['OnSetChange'] =$OnSetChange;
$_SESSION['FileGetMethod'] =$FileGetMethod;
$root_folder = basename($_SERVER['REQUEST_URI']);
if(substr($root_folder, -4) == '.php')
{
$root_folder = basename(dirname($_SERVER['REQUEST_URI']));
}
switch ($root_folder)
{
case "0": $DirectLink="0"; break;
case "home": $DirectLink="1"; break;
case "aanvragen": $DirectLink="2"; break;
case "laatstgedraaid": $DirectLink="3"; break;
case "contact": $DirectLink="4"; break;
case "admin": $DirectLink="5"; break;
default: $DirectLink="1";
}
if (isset($DirectLink))
{
$stdHomeContent = $DirectLink;
}
?>
<script>
$((document).ready(function() {
$('#container').Tabs({defaultContent:<?php echo $stdHomeContent;?>});
$('a.ILinkIt').click(function(){
window.open(this.href);
return false;
});
}));
</script>
Edit:
Ik heb code-tags geplaatst. Gelieve dit in het vervolg zelf toe te voegen aan je bericht.
Zie ook: Veel gestelde vragen: Welke UBB-codes kan ik gebruiken.
Zie ook: Veel gestelde vragen: Welke UBB-codes kan ik gebruiken.
Gewijzigd op 24/01/2019 12:50:36 door - Ariën -
Regel 21 : zet er eens php achter
Wat Adoptive Solution zegt is het wel raadzaam om volledige php-tags te gebruiken: <?php, maar dit zou niks te maken kunnen hebben met het accolade probleem.
Ik zou zeggen: tel je accolades eens na, en spring ze consequent in met TAB. Dan kan je het in je editor of zelfs met een liniaal prima zien wat er niet geopend of gesloten is.
Je server zal die regels na 21 dan niet herkennen als een stuk php, dus de } van regel 22 wordt niet als php gezien, net als de rest tot de volgende <¿php
Gewijzigd op 24/01/2019 15:58:35 door Ivo P
Wat @Ivo zegt. Als je dan dus ergens "php" vergeet na een <? openingshaak dan resulteert dit vaak in bovengenoemde fout.
Het ligt er dan zeker aan of of short_tags uitstaan?
http://php.net/manual/en/language.basic-syntax.phptags.php
Quote:
PHP also allows for short open tag <¿ (which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option).
Gewijzigd op 24/01/2019 23:04:49 door Ivo P
Iedereen bedankt voor het meedenken.