kostenloser Webspace werbefrei: lima-city


Fehler beim Prasen

lima-cityForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    j********k

    Hi habe einen Script geschrieben, aber irgendiwe bekomme ich einen fehler beim Prasen.
    Hier der Fehler:

    Parse error: syntax error, unexpected $end in D:\apachefriends\xampp\htdocs\messages.php on line 400

    und hier ist der Script:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Unbenanntes Dokument</title>
    <style type="text/css">
    body {font-family:Arial, Helvetica, sans-serif; font-size:12px;}
    .navigation {font-family:Arial, Helvetica, sans-serif; font-size:14px;}
    .header {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; font-weight:bold; color:#000000;}
    .special {font-size:1px;}
    .submit {font-size:10px;}
    .autor {font-size:12px; font-style:italic;}
    .newstext {font-size:12; font-family:Verdana, Arial, Helvetica, sans-serif;}
    .text {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
    a:link {font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000; text-decoration:none}
    a:hover {font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000; text-decoration:none}
    a:visited {font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000; text-decoration:none}
    </style>
    </head>

    <body>
    <table align="center">
    <tr>
    <td><img src="pics/top_header.gif"></td>
    </tr>
    </table>
    <table align="center" width="center" border="1">
    <tr>
    <?php
    include ('left.php')
    ?>
    <td width="500" rowspan="100" align="center" valign="top" background="pics/bgtable.gif"><img src="pics/news_header_menu.gif">

    <!-- Anfang Tabelle Mitte -->

    <table width="100%" heigt="100%">
    <tr>
    <td colspan="3">&nbsp;</td>
    </tr>
    <?php
    echo'
    <tr>
    <td width="20">&nbsp;</td><td width="460px" background="pics/news_menu.gif" align="left" style="background-repeat:no-repeat; background-position:top; background-color:#FFFFFF;"><font class="header">Nachrichten Box</font>
    <br><br>

    <!-- Anfang Men? Mitte 1 -->

    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td height="2px" class="special"></td>
    </tr>
    <tr>
    <td width="10%" class="newstext" align="center" colspan="4" style="border-left:dotted 1px #999999; border-top:dotted 1px #999999; border-bottom:dotted 1px #999999; border-right:dotted 1px #999999;"><a href="index.php?go=messages">Eingang</a>&raquo; &raquo;<a href="index.php?go=messages&mode=outbox">Ausgang</a> &raquo; &raquo;<a href="index.php?go=messages&mode=new">Neue Nachricht</a></td>
    </tr>
    <tr>
    <td height="2px" class="special"></td>
    </tr>
    ';
    if($go == "messages" && $mode == "new")
    {
    include('dbconnect.php');

    $abfrage = "SELECT nick FROM comm_users";
    $ergebnis = mysql_query($abfrage);

    echo'
    </table>
    <br>
    <form action="index.php?go=messages&mode=new" method="post">
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">An:</td><td width="410" class="newstext">
    <select name="touser">';

    if(!isset($_GET['touser']))
    {
    while($row = mysql_fetch_array($ergebnis))
    {
    echo'
    <option value="'.$row['nick'].'">'.$row['nick'].'</option>';
    }
    }
    else
    {
    $user = $_GET['touser'];
    echo'
    <option value="'.$user.'" selected>'.$user.'</option>';
    while($row = mysql_fetch_array($ergebnis))
    {
    echo'
    <option value="'.$row['nick'].'">'.$row['nick'].'</option>';
    }
    }

    echo'
    </select>
    </td>
    </tr>
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">Titel:</td><td width="410" class="newstext"><input type="text" name="title"></td>
    </tr>
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">Text:</td><td width="410" class="newstext"><textarea name="text2" cols="39" rows="7"></textarea></td>
    </tr>
    <tr>
    <td width="460" class="newstext" colspan="3" align="center"><input type="submit" name="send2" value="Abschicken"></td>
    </tr>
    </form>';
    if(isset($_SESSION['nick']))
    {
    if($send2 && $title != "" && $text2 != "")
    {
    $time = time();
    $server = $_SERVER['REMOTE_ADDR'];
    $session_name = $_SESSION['nick'];
    $sql = "INSERT INTO comm_messages (IP,fromuser,touser,title,text,date,ifread) VALUES ('$server','$session_name','$touser','$title','$text2','$time','0')";
    mysql_query($sql) OR die(mysql_error());
    echo'
    <tr>
    <td width="460" class="text" colspan="3"><b>Nachricht abgesendet:</b> Nachricht erfolgreich abgesendet.<meta HTTP-EQUIV="Refresh" CONTENT="1; url=http://sirseven.xardas.lima-city.de/page/index.php?go=messages"></td>
    </tr>';
    }
    elseif($send2 && title == "" )
    {
    echo'
    <tr>
    <td width="460" class="text" colspan="3"><b>Fehler:</b> Alle Felder m?ssen ausgef?llt werden.<meta HTTP-EQUIV="Refresh" CONTENT="1; url=http://sirseven.xardas.lima-city.de/page/index.php?go=messages&mode=new"></td>
    </tr>';
    }
    }
    elseif(!isset($_SESSION['nick']))
    {
    echo'
    <tr>
    <td width="460" class="text" colspan="3"><b>Fehler:</b> Nicht eingelogt.</td>
    </tr>';
    }
    }
    elseif($go == "messages" && $mode == "outbox")
    {
    include('dbconnect.php');

    $abfrage_message = "SELECT * FROM comm_messages WHERE fromuser = '".$_SESSION['nick']."' ORDER BY date DESC";
    $ergebnis_message = mysql_query($abfrage_message);
    $abfrage_user = "SELECT * FROM comm_users WHERE nick = '".$row['touser']."'";
    $ergebnis_user = mysql_query($abfrage_user);
    $row_user = mysql_fetch_array($ergebnis_user);
    echo'
    </table>
    <br>
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="65%" class="newstext" bgcolor="#cccccc">Titel</td><td width="15%" class="newstext" bgcolor="#cccccc">Empf?nger</td><td width="20%" class="newstext" bgcolor="#cccccc">Datum</td>
    </tr>
    </table>
    ';
    $request = "SELECT * FROM comm_messages WHERE fromuser = '".$_SESSION['nick']."'";
    $query = mysql_query($request);
    $rows = mysql_num_rows($query);
    if($rows != "0") {
    while($row_message = mysql_fetch_array($ergebnis_message)) {
    $title = htmlspecialchars($row_message['title']);
    if($row_message['ifread'] == "1")
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="65%" class="newstext"><a href="index.php?go=messages&mode=view&id='.$row_message['ID'].'&user='.$row_message['touser'].'">'.$title.'</td><td width="15%" class="newstext">'.$row_message['touser'].'</td><td width="20%" class="newstext">'.date("d.m.y H:i",$row_message['date']).'</td>
    </tr>
    <br>';
    }
    else
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="65%" class="newstext"><a href="index.php?go=messages&mode=view&id='.$row_message['ID'].'&user='.$row_message['touser'].'"><b>'.$title.'</b></td><td width="15%" class="newstext">'.$row_message['touser'].'</td><td width="20%" class="newstext">'.date("d.m.y H:i",$row_message['date']).'</td>
    </tr>
    <br>';
    }
    }
    }
    else
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="100%" class="newstext">Keine Nachrichten</td>
    <table>
    ';
    }
    }
    elseif($go == "messages" && $mode == "delet")
    {
    $touser = $_GET['touser'];
    $id = $_GET['id'];
    include('dbconnect.php');
    echo'
    </table>
    <br>';
    $abfrage = "DELETE FROM comm_messages WHERE touser = '".$touser."' AND id = '".$id."'";
    mysql_query($abfrage) OR die(mysql_error());
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="100%" class="newstext">Nachricht gel?scht<meta HTTP-EQUIV="Refresh" CONTENT="1; url=http://sirseven.xardas.lima-city.de/page/index.php?go=messages"></td>
    </tr>';

    }
    elseif($go == "messages" && $mode == "view")
    {
    $id = $_GET['id'];
    $touser = $_GET['user'];
    include('dbconnect.php');
    echo'
    </table>
    <br>';
    $abfrage_message = "SELECT * FROM comm_messages WHERE id = '".$id."' AND touser = '".$touser."'";
    $ergebnis_message = mysql_query($abfrage_message);
    $row_message = mysql_fetch_array($ergebnis_message);
    $abfrage_user = "SELECT * FROM comm_users WHERE nick = '".$row_message['fromuser']."'";
    $ergebnis_user = mysql_query($abfrage_user);
    $row_user = mysql_fetch_array($ergebnis_user);
    $abfrage_user2 = "SELECT * FROM comm_users WHERE nick = '".$row_message['touser']."'";
    $ergebnis_user2 = mysql_query($abfrage_user2);
    $row_user2 = mysql_fetch_array($ergebnis_user2);
    $title = htmlspecialchars($row_message['title']);
    $text = nl2br(htmlspecialchars($row_message['text']));
    if($row_message['ifread'] == "0" && $row_message['touser'] == $_SESSION['nick'])
    {
    $update = "UPDATE comm_messages SET ifread = 1 WHERE ID = '".$id."' AND touser = '".$touser."'";
    mysql_query($update);
    }
    else
    {
    }
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">Autor:</td><td width="410" class="newstext"><a href="index.php?go=viewprofile&id='.$row_user['ID'].'">'.$row_message['fromuser'].'</td>
    </tr>
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">Empf?nger:</td><td width="410" class="newstext"><a href="index.php?go=viewprofile&id='.$row_user2['ID'].'">'.$row_message['touser'].'</td>
    </tr>
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">Titel:</td><td width="410" class="newstext">'.$title.'</td>
    </tr>
    <tr>
    <td width="50" class="newstext" bgcolor="#cccccc">Text:</td><td width="410" class="newstext">'.$text.'</td>
    </tr>';
    }
    elseif($go == "messages" && mode == "error")
    {
    include('dbconnect.php');
    $time = time();
    $server = $_SERVER['REMOTE_ADDR'];
    $session_name = $_SESSION['nick'];
    $ort = $HTTP_REFERER;
    $text = '
    Ein Fehler gefunden!<br \>
    Alle Daten werden mitgeschickt!<br \>
    Art der Meldung: <b><font color="#FFFF00">ERROR</font></b><br \>
    Auftretungsort: <b>'.$ort.'</b><br \>
    IP-Adresse des Users bei dem der Fehler aufgetreten ist: <b>'.$server.'</b><br \>
    User bei dem der Fehler aufgetreten ist: <b>'.$session_name.'</b><br \>
    Zeit des Fehlerauftritts: <b>'.date("d.m.y -- H:i",$time).'</b><br \>';

    $sql = "INSERT INTO comm_messages (IP,fromuser,touser,title,text,date,ifread) VALUES ('$server','$session_name','admin','ERROR','$text','$time','0')";
    mysql_query($sql) OR die(mysql_error());
    }
    elseif($go == "messages" && $mode == "mod")
    {
    $rang = $_SESSION['rang'];
    if($rang == "mod" OR $rang == "admin")
    {
    include('dbconnect.php');
    echo'
    </table>
    <br>
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="45%" class="newstext" bgcolor="#cccccc">Titel</td><td width="15%" class="newstext" bgcolor="#cccccc">Autor</td><td width="20%" class="newstext" bgcolor="#cccccc">Datum</td><td width="20%" class="newstext" bgcolor="#cccccc">Optionen</td>
    </tr>
    </table>
    <br>';
    $request = "SELECT * FROM comm_messages WHERE touser = 'mod'";
    $query = mysql_query($request);
    $rows = mysql_num_rows($query);
    if($rows != "0") {
    $abfrage = "SELECT * FROM comm_messages WHERE touser = 'mod' ORDER BY date DESC";
    $ergebnis = mysql_query($abfrage);
    while($row = mysql_fetch_array($ergebnis)) {
    $title = htmlspecialchars($row['title']);
    if($row['ifread'] == "1")
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="45%" class="newstext"><a href="index.php?go=messages&mode=view&id='.$row['ID'].'&user='.$row['touser'].'">'.$title.'</td><td width="15%" class="newstext">'.$row['fromuser'].'</td><td width="20%" class="newstext">'.date("d.m.y H:i",$row['date']).'</td><td width="20%" class="newstext"><a href="index.php?go=messages&mode=delet&id='.$row['ID'].'&touser='.$_SESSION['nick'].'">L?schen</td>
    <table>
    <br>';
    }
    else
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="45%" class="newstext"><a href="index.php?go=messages&mode=view&id='.$row['ID'].'&user='.$row['touser'].'"><b>'.$title.'</b></td><td width="15%" class="newstext">'.$row['fromuser'].'</td><td width="20%" class="newstext">'.date("d.m.y H:i",$row['date']).'</td><td width="20%" class="newstext"><a href="index.php?go=messages&mode=delet&id='.$row['ID'].'&touser='.$_SESSION['nick'].'">L?schen</td>
    <table>
    <br>';
    }
    }
    }
    else
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="100%" class="newstext">Keine Spam oder Error meldungen</td>
    <table>
    ';
    }
    }
    elseif($go == "messages")
    {
    include('dbconnect.php');
    echo'
    </table>
    <br>
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="45%" class="newstext" bgcolor="#cccccc">Titel</td><td width="15%" class="newstext" bgcolor="#cccccc">Autor</td><td width="20%" class="newstext" bgcolor="#cccccc">Datum</td><td width="20%" class="newstext" bgcolor="#cccccc">Optionen</td>
    </tr>
    </table>
    <br>';
    $request = "SELECT * FROM comm_messages WHERE touser = '".$_SESSION['nick']."'";
    $query = mysql_query($request);
    $rows = mysql_num_rows($query);
    if($rows != "0") {
    $abfrage = "SELECT * FROM comm_messages WHERE touser = '".$_SESSION['nick']."' ORDER BY date DESC";
    $ergebnis = mysql_query($abfrage);
    while($row = mysql_fetch_array($ergebnis)) {
    $title = htmlspecialchars($row['title']);
    if($row['ifread'] == "1")
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="45%" class="newstext"><a href="index.php?go=messages&mode=view&id='.$row['ID'].'&user='.$row['touser'].'">'.$title.'</td><td width="15%" class="newstext">'.$row['fromuser'].'</td><td width="20%" class="newstext">'.date("d.m.y H:i",$row['date']).'</td><td width="20%" class="newstext"><a href="index.php?go=messages&mode=delet&id='.$row['ID'].'&touser='.$_SESSION['nick'].'">L?schen</td>
    <table>
    <br>';
    }
    else
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="45%" class="newstext"><a href="index.php?go=messages&mode=view&id='.$row['ID'].'&user='.$row['touser'].'"><b>'.$title.'</b></td><td width="15%" class="newstext">'.$row['fromuser'].'</td><td width="20%" class="newstext">'.date("d.m.y H:i",$row['date']).'</td><td width="20%" class="newstext"><a href="index.php?go=messages&mode=delet&id='.$row['ID'].'&touser='.$_SESSION['nick'].'">L?schen</td>
    <table>
    <br>';
    }
    }
    }
    else
    {
    echo'
    <table align="center" width="95%" style="border-left:solid 1px #CCCCCC; border-right:solid 1px #CCCCCC; border-top:solid 1px #CCCCCC; border-bottom:solid 1px #CCCCCC;">
    <tr>
    <td width="100%" class="newstext">Keine Nachrichten</td>
    <table>
    ';
    }
    }
    echo'
    </table>
    <br>

    <!-- Ende Men? Mitte 1 -->

    </td>
    <td width="20">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3">&nbsp;</td>
    </tr>';
    ?>
    <tr>
    <td colspan="3">&nbsp;</td>
    </tr>
    </table>

    <!-- Ende Tabelle Mitte 1 -->
    <?php
    include ('right.php');
    ?>

    </tr>
    </table>
    </body>
    </html>

    w?re cool wenn ihr den Fehler findet

    Danke im Voraus

    Malte
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. b***u

    Hoi

    Denkst du, wir suchen jetzt die Zeile 400? Such sie mal selbst heraus, und poste dann noch die Zeilen 399 und 401 (falls vorhanden).

    Liebe Gr??e,
    Ballu
  4. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!