PHP Parse error: syntax error, unexpected $end

Hallo ich habe das Problem, dass beim Aufruf meiner Seite folgende Fehlermeldung kommt:

Parse error: syntax error, unexpected $end in C:\webserver\htdocs\test\index.php on line 59

PHP:
<?php

switch($_GET[id])
{
	case "1" : $site='Home';
				break;
	case "2" : $site='News';
				break;
	case "3" : $site='Download';
				break;
	default  : $site='Home';
}

echo <<<SITE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
		<meta name="generator" content="Adobe GoLive" />
		<title>MrSpider's Site</title>
	</head>
	
	<style type="text/css">
	
	a : visited {font-style: normal; color: #000000;text-decoration: none}
	
	</style>

	<body>
		<div style="position:relative;width:801px;height:1000px;margin:auto;-adbe-g:p;">
			<div style="position:absolute;top:0px;left:0px;width:800px;height:100px;">
				<img src="(EmptyReference!)" alt="" height="100" width="800" border="0" /></div>
			<div style="position:absolute;top:100px;left:0px;width:112px;height:208px;-adbe-c:c">
				<p><a href="index.php?id=1">Home</a></p>
				<p><a href="index.php?id=2">News</a></p>
				<p><a href="index.php?id=3">Downloads</a></p>
			</div>
			<div style="position:absolute;top:100px;left:112px;width:688px;height:899px;-adbe-c:c">
SITE;			

switch($site)
{
	case 'News' : include 'news.php';
					break;
}

echo <<<END
			</div>
		</div>
	</body>

</html>

END;

?>


Ich habe das ganze schon auf fehlende Klammern überprüft, habe aber nichts gefunden.
Schon mal im Voraus vielen Dank für eure Hilfe.


Spider
 
PHP:
<?php

switch($_GET[id])
{
    case "1" : $site='Home';
                break;
    case "2" : $site='News';
                break;
    case "3" : $site='Download';
                break;
    default  : $site='Home';
}

?>
//<<<SITE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <meta name="generator" content="Adobe GoLive" />
        <title>MrSpider's Site</title>
    </head>
    
    <style type="text/css">
    
    a : visited {font-style: normal; color: #000000;text-decoration: none}
    
    </style>

    <body>
        <div style="position:relative;width:801px;height:1000px;margin:auto;-adbe-g:p;">
            <div style="position:absolute;top:0px;left:0px;width:800px;height:100px;">
                <img src="(EmptyReference!)" alt="" height="100" width="800" border="0" /></div>
            <div style="position:absolute;top:100px;left:0px;width:112px;height:208px;-adbe-c:c">
                <p><a href="index.php?id=1">Home</a></p>
                <p><a href="index.php?id=2">News</a></p>
                <p><a href="index.php?id=3">Downloads</a></p>
            </div>
            <div style="position:absolute;top:100px;left:112px;width:688px;height:899px;-adbe-c:c">
//SITE;      
<?php
switch($site)
{
    case 'News' : include 'news.php';
                    break;
}
?>
//<<<END
            </div>
        </div>
    </body>

</html>

//END;

?>
so ?
 
Ich hab zwar jetzt keine Ahnung was die Änderungen von 0wnZ bewirken, aber dein Problem kommt mir bekannt vor. Ich glaube die erste Zeile nach einem echo<<< muss in der ersten Spalte beginnen (keine Leerschritte am Anfang). Das hat mich auch schon viele graue Haare gekostet. Ich meine so hatte ich das Problem gelöst. Warum das so seien muss versteh ich aber auch nicht.

Gruß odigo
 
So kommt zwar keine Fehlermeldung mehr aber Teile des php-code kommen am Schluss beim html-code raus:

PHP:
//<<<SITE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <meta name="generator" content="Adobe GoLive" />
        <title>MrSpider's Site</title>
    </head>

    
    <style type="text/css">
    
    a : visited {font-style: normal; color: #000000;text-decoration: none}
    
    </style>

    <body>
        <div style="position:relative;width:801px;height:1000px;margin:auto;-adbe-g:p;">
            <div style="position:absolute;top:0px;left:0px;width:800px;height:100px;">
                <img src="(EmptyReference!)" alt="" height="100" width="800" border="0" /></div>
            <div style="position:absolute;top:100px;left:0px;width:112px;height:208px;-adbe-c:c">
                <p><a href="index.php?id=1">Home</a></p>

                <p><a href="index.php?id=2">News</a></p>
                <p><a href="index.php?id=3">Downloads</a></p>
            </div>
            <div style="position:absolute;top:100px;left:112px;width:688px;height:899px;-adbe-c:c">
//SITE;      
//<<<END
            </div>
        </div>
    </body>

</html>

//END;

?>

EDIT:
@odigo
geändert; aber es kommt immer noch die gleiche Fehlermeldung

PHP:
echo <<<SITE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

.....

echo <<<END
</div>
		</div>
	</body>
</html>

END;

?>


EDIT2:

Die Lösung von Ownz funktioniert doch.
Sry

Vielen Dank für die schnelle Hilfe!!

Spider
 
Zurück
Oben