kostenloser Webspace werbefrei: lima-city


Finde den Fehler nicht

lima-cityForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    marvinkleinmusic

    Kostenloser Webspace von marvinkleinmusic

    marvinkleinmusic hat kostenlosen Webspace.

    Hallo Zusammen!


    Ich habe hier einmal einen extremen Code und ich finde den dazu gehörigen Fehler nicht.

    Der ERROR:
    Parse error: syntax error, unexpected end of file in C:\Program Files (x86)\Xampp2\htdocs\V1.3.2.i\download.php on line 394

    Ich finde den doofen Fehler einfach nicht.

    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
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    <?php require("header.php"); ?>
    <title>MarvinKleinMusic - Downloads</title>
    <link rel="stylesheet" type="text/css" href="css/download.css">
     
    <script type="text/javascript">
    function setchecked(selectid,valuewert)
    {
    optionen=document.getElementById(selectid).options;
    for(i=0;i<optionen.length;i++)
    {
    if(optionen[i].value==valuewert)
    {
    optionen[i].setAttribute('selected','selected');
    }
    }
    }
     
    function multipleWert(sObj, trenn) {
    var rVal = '';
    for (var i=0; i<sObj.options.length; i++) with (sObj.options[i])
    if (selected) rVal += trenn + value;
    return rVal.substring(trenn.length);
    }
     
    </script>
     
     
    <!----------------CONTENT-------------->
    <?php
        include("connect/config.php");
        // Verbindungsvariable samt Zugangsdaten festlegen
        @$db = mysqli_connect($url, $user, $pw, $dbname);
     
    if (isset ($_GET["q"]) and !empty($_GET["q"])){
     
    $suchwort = mysqli_real_escape_string($db, $_GET["q"]);
     
    if(isset($_GET["max"])){
    $eintraege_maximal =mysqli_real_escape_string($db, $_GET["max"]);
    }else{
    $eintraege_maximal = "5";
    }
     
    if($eintraege_maximal == "alle"){
    $abfrage   "SELECT * FROM downloads WHERE titel LIKE '%$suchwort%'";
    }else{
    $abfrage   = "SELECT * FROM downloads WHERE titel LIKE '%$suchwort%' LIMIT $eintraege_maximal";
    }
     
     
    $ergebnis  = $db->query($abfrage);
    $menge     = $ergebnis->num_rows;
     
    $suchwort = shorten($suchwort);
     
    echo "
    <body onload=\"setchecked('max_results',$eintraege_maximal)\">
    <br />
    <center>
     
    <table border=\"1\">
     
    <tr>
     
    <th>
    <span>Suchergebnisse für:$suchwort</span> 
    </th>
     
    <th>
    <span>Suchergebnisse:$menge </span>
    </th>
     
    <th>
     
    <span>Max Suchergebnisse:</span>
    <select id=\"max_results\"  size=\"1\" onchange=\"window.location.href = 'download.php?q=$suchwort&max=' + multipleWert(document.getElementById('max_results'), '&') \">
    <option value='5'>5
    <option value='10'>10
    <option value='15'>15
    <option value='20'>20
    <option value='25'>25
    <option value='alle'>Alle
    </select>
     
    </th>
     
    </tr>
    </table>
    </center>
    <br />
    <hr style='width:600px; border-style: dashed; border-width: 1px; height:1px; color:#000000;'>
     
    <p></p>";
     
    if($menge == 0)
    {
    echo "
    <br>
    <b>Leider keine Suchtreffer!</b>
    <br>
    <a href='download.php'>Zurück</a>";
    }
     
     
     
     
    While($row = $ergebnis->fetch_object())
    {
     
    if ($row->visible == "1"){
    echo "
     
    <center>
    <table align='center' border='1'  cellspacing='10' width='600px' style='border-collapse: collapse'>
     
    <tr>
    <td align='center' style='border-bottom-width:0px;'>
     
    <span style=\"color: orange; font-size: 18pt;\">$row->titel</span>";
     
    If (Isnew($row->date))
    {
    echo " <img alt='' src='images/neu-button.png' />";
    }
     
    echo "</td></tr>";
     
     
    if($row->view == 1){
    $action = "view";
    }else{
    $action = "download";
    }
     
    ?>
     
    <tr>
    <td align='center' style='border-bottom-width:0px;border-top-width:0px'>
    <a href=/Get_File.php?id=<? echo $row->id; ?>&action=<? echo $action; ?>><img alt="" src="images/Download_Button.png" /></a>
    </td>
    </tr>
     
    <tr align='center'>
    <td>
    <span style="font-size: 8pt; color:orange;" >Download Aufrufe: <? echo $row->aufrufe; ?></span>
    </td>
    </tr>
     
    </table>
    </center>
    <br/>
     
    <?
    }
    }
     
     
     
    }
    elseif(isset($_GET["kategorie"]) and !empty($_GET["kategorie"]))
    {
     
     
    if(!isset($_GET["seite"]) or empty($_GET["seite"]))
    {
    $seite = 1;
    }else{
    $seite = $_GET["seite"]; 
    }
     
    $eintraege_pro_seite = 11; //Immer plus 1
    $start = $seite * $eintraege_pro_seite - $eintraege_pro_seite;
     
    $kategorie = mysqli_real_escape_string($db, $_GET["kategorie"]);
    $abfrage   = "SELECT * FROM downloads WHERE kategorie = '$kategorie' ORDER BY titel ASC LIMIT $start, $eintraege_pro_seite";
    $ergebnis  = $db->query($abfrage);
    ?>
     
    <br />
    <center>
    <span style="font-size: 18pt;">Hier finden sie Downloads rund um das Thema "<? echo $kategorie; ?>" </span>  
    <hr style="width:600px; color:black; background-color:black; height:2px; text-align:center; border:0px ">
    </center>
     
    <?
    While($row = $ergebnis->fetch_object())
    {
    if ($row->visible == "1"){
    if($row->view == 1){
    $action = "view";
    }else{
    $action = "download";
    }
     
    echo "<center><a style='text-decoration:none;' href='/Get_File.php?id=$row->id&action=$action'><font style='color:orange; font-size: 18pt;'>$row->titel</font></a>";
     
    If (Isnew($row->date))
    {
    echo " <img alt='' src='images/neu-button.png' />";
    }
     
    echo "<br />";
     
     
    ?>
     
    <a href="/Get_File.php?id=<? echo $row->id; ?>&action=<? echo $action; ?>"><img alt="" src="images/Download_Button.png" /></a>
    <br />
    <span style="font-size: 8pt; color:#fff;" >
     
    <?
    $abfrage2  = "SELECT * FROM downloads WHERE kategorie = '$kategorie' AND titel = '$row->titel'";
    $ergebnis2 = $db->query($abfrage2);
     
    $instrumente = "";
     
    While($row2 = $ergebnis2->fetch_object())
    {
     
    if(!empty($instrumente)){
    $instrumente .= "," . $row2->instrument;
    }else{
    $instrumente .= $row2->instrument;
    }
     
    }
     
    if($row->view == 1){
     
    if(!empty($instrumente)){
    echo "Instrument/e: " . $instrumente;
    }else{
    echo "Instrument/e: Keine Angaben";
    }
     
    }else{
    echo "Download Aufrufe: $row->aufrufe";
    }
     
    echo "</span>
    <hr style='width:800px; border-style: dashed; border-width: 1px; height:1px; color:#000000; '></center>";
     
    }
    }
     
    $result = $db->query("SELECT id FROM downloads WHERE kategorie = '$kategorie'");
    $menge = $result->num_rows;
     
    $wieviel_seiten = $menge / $eintraege_pro_seite;
     
    echo "<div align=\"center\">";
    echo "<b>Seite:</b> ";
     
    for($a=0; $a < $wieviel_seiten; $a++)
    {
    $b = $a + 1;
     
    if($seite == $b)
    {
    echo "  <b>$b</b> ";
    }else{
    echo "  <a href='download.php?kategorie=$kategorie&seite=$b'>$b</a> ";
    }
     
    }
    echo "</div>";
     
    }else{
     
    $abfrage = "SELECT * FROM download_kategorien ORDER BY ID ASC ";
    $ergebnis = $db->query($abfrage);
     
    ?>
    <br />
    <p style="position:absolute; display:block;">
    <form name="suche">
    <input type="text" name="q" id="suchfeld">  <input type="button" id="button" value="Suchen" onclick="top.location.href = 'download.php?q=' + document.suche.q.value">
    </form>
    </p>
     
     
    <?
     
    $in_zeile = 0;
     
    While($row = $ergebnis->fetch_object()){
     
     
     
     
    ////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    ////////////////////////////kategorien anzeige///////////////////////////
    ////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    echo"<a href='download.php?kategorie=$row->titel'><img src='$row->icon' alt='$row->title' title='$row->title'></a>";
    ////////////////////////////////////////////////////////////////////
     
     
     
     
     
    }
     
     
     
     
     
     
    $abfrage        = "SELECT * FROM downloads";
    $abfrage1       = "SELECT * FROM downloads ORDER BY id DESC LIMIT 3";
    $ergebnis       = $db->query($abfrage);
    $ergebnis1       = $db->query($abfrage1);
    $downloadtotal  = $ergebnis->num_rows;
     
    $abfrage        = "SELECT * FROM download_kategorien";
    $ergebnis       = $db->query($abfrage);
    $kategorientotal= $ergebnis->num_rows;
    ?>
    <h3>Die 3 neusten Downloads:</h3>
        <div style='border:none; height:200px; width:200px;'>
            <table style="border:none;">
                <tr>
    <?php
    while($rowneu =$ergebnis1->fetch_object())
    {
    //if
    if($rowneu->view == 1){
    $action = "view";
    }else{
    $action = "download";
    }
    echo "<td style='padding-left:20px;'><span style='color:orange; font-size: 11pt;'>$rowneu->titel</span><br />";
    //if ende
    ?>
    <a href="/Get_File.php?id=<? echo $rowneu->id; ?>&action=<? echo $action; ?>"><img alt="" src="images/Download_Button.png" /></a>
    <br />
    </td>
    <?php
     
    }
    //while ende
    ////////////////////////////////////APPS//////////////////////////////
     
    echo"</tr></table></div>";
    ?>
    <h2>Apps Downloaden:</h2>
        <table style="border:none;">
            <tr>
                <td style="padding-left:3px;"><a href="http://bit.ly/magicpianoios"><img src="images/download/icon-piano.png" alt="Magic Piano" title="Magic Piano"></a></td>
                <td style="padding-left:3px;"><a href="http://p.smule.com/u/c1e4afa8"><img src="images/download/icon-karaoke.png" alt="Sing! Karaoke" title="Sing! Karaoke"></a></td>
                <td style="padding-left:3px;"><a href="http://p.smule.com/u/c4bd899c"><img src="images/download/icon-cinebeat.png" alt="Cinebeat" title="Cinebeat"></a></td>
                <td style="padding-left:3px;"><a href="http://p.smule.com/u/19e6f15b"><img src="images/download/icon-guitar.png" alt="Guitar!" title="Guitar!"></a></td>
            </tr>
        </table>
     
    <?php
    echo "<p></p>Downloads total: $downloadtotal  Kategorien total: $kategorientotal";
    }
     
     
    function Isnew($db_date){
    $date = time();
    $bis_wann_neu = "604800";
     
    $unterschied = $date - $db_date;
     
    if($unterschied < $bis_wann_neu)
    {
    return true;
    }
    }
     
    function shorten($text)
    {
     
    if(strlen($text) > 16) {
     
    $text = substr($text,0,16);
    $text = $text . "..";
    return $text;
    }
    else
    {
    return $text;
    }
    }
     
     
    mysqli_close($db);
     
    include("footer.php"); ?>
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

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

  3. Klammer die letzte Zeile aus und schau mal ob der Fehler immer noch da ist.

    Gängige Ursachen für einen Parse Error sind:
    -Strichpunkt ( ; ) am Ende einer Zeile vergessen
    -Schließende Klammer ) vergessen
    -Schließende geschweifte Klammer } vergessen
    -Falsches setzen von Anführungszeichen " oder '
    -Vergessen eines Punktes . beim verketten von Strings

    Die Zeile, die in der Fehlermeldung genannt wird, muss nicht immer die Zeile sein, die auch den Fehler verursacht. Häufig ist die Zeile davor oder danach schuld.
    Wenn du einen Editor benutzt, der Syntax Highlighting unterstützt, dann kannst du leicht sehen, wo du Anführungszeichen falsch gesetzt hast

    Beitrag zuletzt geändert: 5.12.2013 14:52:39 von onur-yavuz
  4. Autor dieses Themas

    marvinkleinmusic

    Kostenloser Webspace von marvinkleinmusic

    marvinkleinmusic hat kostenlosen Webspace.

    Hallo nochmal,

    Der Fehler taucht auch schon beim Kopieren auf (Sprich die Datei die ich vom Webspace runterlade)

    Allerdings auf dem Webspace läuft die Perfekt doch sobald ich die nötigen Datein in mein xampp verzeichnis ziehe taucht der Error wieder auf.


    Eine Idee?

    LG
  5. Es liegt an "<?". Du musst "<?php" schreiben. (z.B. Zeile 185)

    Seit php5.0 wird empfohlen die short_open_tag abzuschalten.
  6. Autor dieses Themas

    marvinkleinmusic

    Kostenloser Webspace von marvinkleinmusic

    marvinkleinmusic hat kostenlosen Webspace.

    Boa danke!

    Das Script ist bestimmt schon 1 Jahr unverändert geblieben jetzt geht es!

    Allerdings habe ich noch eine Fehlermeldung die mir Fremd ist:
    Notice: Undefined property: stdClass::$title in C:\Program Files (x86)\Xampp2\htdocs\V1.3.2.i\download.php on line 298
  7. Hallo :)

    In der Zeile 298 verwendest du erst $row->titel und dann $row->title ..
    Ich vermute einfach mal, dass es daran liegt, dass du keine Spalte "title" in deiner Datenbank hast :D

    Kann das sein?

    echo"<a href='download.php?kategorie=$row->titel'><img src='$row->icon' alt='$row->title' title='$row->title'></a>";
  8. Autor dieses Themas

    marvinkleinmusic

    Kostenloser Webspace von marvinkleinmusic

    marvinkleinmusic hat kostenlosen Webspace.

    Jop danke dir!


    Jetzt geht eigendlich alles :thumbs:
  9. 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!