Thx

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Thx

    Hi, in der Index eines GB's kommt der Fehler: Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in C:\apachefriends\xampp\htdocs\guestbook\index.php on line 21

    Hier die PHP:
    PHP-Code:
    <html> 
    <head> 
      <title>Mein Gästebuch</title> 
    <link rel="stylesheet" type="text/css" href="style/style.css"> 
    </head> 
    <body> 
    <? 
    include("inc/connect.inc.php"); 
    ?> 
    <table width="600" border="0" bgcolor="#000000" cellpadding="5" cellspacing="1" align="center"> 
      <tr> 
        <td height="40" bgcolor="#227CAC" align="center" valign="middle"><span class="header">Mein Gästebuch</span></td> 
      </tr> 
      <tr> 
        <td bgcolor="#dedede" valign="top" align="center"> 
        <a href="eintragen.php">In das Gästebuch eintragen</a> 
        <br><br> 
          <? 
            $abfrage = @ mysql_query("SELECT * FROM gbook ORDER BY id DESC")or die("Konnte den SELECT-Befehl nicht ausführen!!!"); 
            while($eintraege = mysql_fetch_object($abfrage)) { 
            echo "<table width="540" border="0" bgcolor="#000000" cellpadding="5" cellspacing="1" align="center">";
            echo "<tr> <td bgcolor="#227CAC" colspan="2"><span class="eintrag">Eintrag ".$eintraege->id." vom ".$eintraege->datum." um ".$eintraege->zeit."</span></td> </tr> "; 
            echo "<tr> <td width="180" bgcolor="#227CAC" valign="top" rowspan="2">"; 
            echo "<table width="170" bgcolor="#1F729F" border="0" cellpadding="2" cellspacing="1" align="center"> "; 
            echo "<tr> "; 
            echo "<td bgcolor="#2E8BBC" colspan="2"><b>Geschrieben von:</b></td></tr>"; 
            echo "<tr> "; 
            echo "<td width="25" bgcolor="#2E8BBC"><img src="images/user.gif" width="16" height="16" alt="Eintrag von ".$eintraege->name."" border="0"></td> "; 
            echo "<td width="145" bgcolor="#2E8BBC" valign="middle">".$eintraege->name."</td></tr> "; 
            echo "<td width="25" bgcolor="#2E8BBC"><a href="mailto:".$eintraege->email.""><img src="images/email.gif" width="18" height="18" alt="E-Mail an ".$eintraege->name." senden" border="0"></a></td> "; 
            echo "<td width="145" bgcolor="#2E8BBC" valign="middle"><a href="mailto:".$eintraege->email."">E-Mail</a></td></tr> "; 
            if(!empty($eintraege->www)) { 
              echo "<td width="25" bgcolor="#2E8BBC"><a href="".$eintraege->[url]www.[/url]"" target="_blank"><img src="images/home.gif" width="16" height="16" alt="Homepage von ".$eintraege->name." besuchen" border="0"></a></td> "; 
              echo "<td width="145" bgcolor="#2E8BBC" valign="middle"><a href="".$eintraege->[url]www.[/url]"" target="_blank">Homepage</a></td></tr>"; 
            } 
            echo "</table>"; 
            echo "</td>"; 
            echo "<td width="360" bgcolor="#dedede">".$eintraege->eintrag."</td></tr>"; 
            echo "<td width="360" bgcolor="#dedede" valign="bottom"><img src="images/ip.gif" width="16" height="16" border="0" alt="".$eintraege->ip_adresse.""> <span class="hinweis">IP-Adresse gespeichert</span></td></tr>"; 
            echo "</table><br>"; 
            } 
            @mysql_free_result($abfrage); 
            @mysql_close(); 
          ?> 
          <a href="eintragen.php">In das Gästebuch eintragen</a> 
        </td> 
      </tr>
    </table>
    </body>
    </html>
    Über Hilfe würd ich mich freuen, muss das mmorgen in der Schule als Belegarbeit abgeben!^^ THX

  • #2
    Re: [Funktion] Problem mit Gäastebuch Index. Fehler T_LNUMBER...

    wie wäre es die " in einem String zu escapen ?
    TBT

    Die zwei wichtigsten Regeln für eine berufliche Karriere:
    1. Verrate niemals alles was du weißt!


    PHP 2 AllPatrizier II Browsergame

    Kommentar


    • #3
      Salut

      du solltest sicherlich mal in allen echo()-Ausgaben die " entwerten z.B.

      PHP-Code:
      echo "<table width="170" bgcolor="#1F729F" border="0" cellpadding="2" cellspacing="1" align="center"> "; 
      PHP-Code:
      echo "<table width=\"170\" bgcolor=\"#1F729F\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" align=\"center\">"
      Siehst du den Unterschied ?

      Diesen Fehler hätte dir aber dein Code-Progi anzeigen müssen. Du gibst ja einen String aus und innerhalb eines Stringes darfst du nur entwertete " verwenden. Wie soll sonst der Parser wissen ob jetzt der String zu Ende ist oder ob's noch weitergeht.

      Gruss

      tobi

      EDIT:
      Sorry TBT unsere Postings haben sich überschnitten
      Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

      [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
      Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

      Kommentar


      • #4
        na hör ma, was steht denn in der zeile 21? markere bitte FETT, was der auszugebende string hierbei ist:
        PHP-Code:
        echo "<table width="540" border="0" [den rest lassschma weg] 

        Kommentar


        • #5
          THX Leute... Ja, wenn man im Suff coden tut! ABer jetz hab ich schon wieder ein Problem! Und zwar:Parse error: parse error, unexpected T_STRING in C:\apachefriends\xampp\htdocs\guestbook\inc\functions.inc.php on line 4

          PHP-Code:
          <? 
          function replace($eintrag) { 
             $eintrag =  str_replace("\r ", "<br>", $eintrag); 
             $eintrag =  str_replace(":-)", "<img src="images/smile.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":)", "<img src="images/smile.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(";-)", "<img src="images/zwinker.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(";)", "<img src="images/zwinker.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":-(", "<img src="images/traurig.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":(", "<img src="images/traurig.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":-D", "<img src="images/d.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":D", "<img src="images/d.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace("(H)", "<img src="images/cool.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace("(h)", "<img src="images/cool.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":-O", "<img src="images/o.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":O", "<img src="images/o.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":P", "<img src="images/p.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":p", "<img src="images/p.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":S", "<img src="images/s.gif" border="0" alt="" title="">", $eintrag); 
             $eintrag =  str_replace(":s", "<img src="images/s.gif" border="0" alt="" title="">", $eintrag); 

          return $eintrag; 

          ?>
          EDIT:
          Smilies deactivated by TBT
          Zuletzt geändert von TBT; 25.11.2004, 22:07.

          Kommentar


          • #6
            schlaf dich erstmal aus und werd nüchtern.

            Kommentar


            • #7
              Re: Re: [Funktion] Problem mit Gäastebuch Index. Fehler T_LNUMBER...

              probiere es nochmals damit
              Original geschrieben von TBT
              wie wäre es die " in einem String zu escapen ?
              TBT

              Die zwei wichtigsten Regeln für eine berufliche Karriere:
              1. Verrate niemals alles was du weißt!


              PHP 2 AllPatrizier II Browsergame

              Kommentar


              • #8
                Thx

                Okey, jetz hab ich s auch gecheckt! Danke für eure Hilfe!

                Kommentar

                Lädt...
                X