Hackerboard Wiki HaboBlog
Hackerboard bei Facebook Hackerboard bei Google+ Hackerboard bei Twitter

[HaBo]

 
(Web-) Design und webbasierte Sprachen Tipps & Tricks, Designabgleich, HTML & Javascript, Flash, ASP, PHP, Perl/CGI...

PHP Parse error: syntax error, unexpected $end

Diskussion: PHP Parse error: syntax error, unexpected $end im Forum (Web-) Design und webbasierte Sprachen, in der Kategorie Web, Network & Multimedia Palace; Anzeige Hallo ich habe das Problem, dass beim Aufruf meiner Seite folgende Fehlermeldung kommt: Parse error: syntax error, unexpected $end ...

Antwort
Alt 23.04.08, 20:50   #1 (permalink)
 
Registriert seit: 31.03.08
MrSpider Leistung: Facit NTK
Likes: 0
PHP Parse error: syntax error, unexpected $end

Anzeige

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-Code:
<?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
MrSpider ist offline   Mit Zitat antworten
Alt 23.04.08, 21:00   #2 (permalink)
 
Registriert seit: 25.06.06
0wnZ Leistung: Facit NTK
0wnZ eine Nachricht über ICQ schicken
Likes: 0
Standard

PHP-Code:
<?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 ?
0wnZ ist offline   Mit Zitat antworten
   
HaBOT
 
- Anzeige -

Werbung ist gerade online    
Alt 23.04.08, 21:14   #3 (permalink)
Senior Member
 
Benutzerbild von odigo
 
Registriert seit: 25.12.04
odigo Leistung: 8086odigo Leistung: 8086
odigo eine Nachricht über ICQ schicken
Likes: 54
Standard

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
odigo ist offline   Mit Zitat antworten
Alt 23.04.08, 21:15   #4 (permalink)
Themenstarter
 
Registriert seit: 31.03.08
MrSpider Leistung: Facit NTK
Likes: 0
Standard

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

PHP-Code:
//<<<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>MrSpiders Site</title>
    </
head>

    
    <
style type="text/css">
    
    
visited {font-stylenormalcolor#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-Code:
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
MrSpider ist offline   Mit Zitat antworten
Antwort
   
- Anzeige -

Werbung ist gerade online    

[HaBo] » Web, Network & Multimedia Palace » (Web-) Design und webbasierte Sprachen » PHP Parse error: syntax error, unexpected $end
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind aus
Pingbacks sind aus
Refbacks sind aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Parse Error beim Ausgeben der array-Anzahl jesus (Web-) Design und webbasierte Sprachen 2 18.02.07 19:28
[php] Parse Error beim Ausgeben der array-Anzahl jesus Code Kitchen 2 18.02.07 19:28
Anfängerfehler: Parse Error deJimmy (Web-) Design und webbasierte Sprachen 5 03.07.06 14:54
makefile.win Build Error schiffe.exe Error 1 Nosferatu_v Code Kitchen 0 13.01.05 18:13
1805 PCI/PNP Error! Adapter ROM Checksum error Fragger Hardware Probleme 0 19.10.01 15:02


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