PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr

PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr (https://www.php-resource.de/forum/)
-   PHP Developer Forum (https://www.php-resource.de/forum/php-developer-forum/)
-   -   [QUOTE]Parse error: syntax error, unexpected '}' in (https://www.php-resource.de/forum/php-developer-forum/95308-quote-parse-error-syntax-error-unexpected-in.html)

Ayline 25-01-2009 10:10

Erledigt Parse error: syntax error, unexpected '}' in
 
Hallo,

ich wollte mal fragen ob mir jemand den Fehler beseitigen kann? Ich habe keine Ahnung von PHP und habe nur etwas rumgespielt und nun erhalte ich einen Fehler:

Zitat:

Parse error: syntax error, unexpected '}' in /var/www/html/web574/html/host/myimages.php on line 108

Code:
Code:

<?require_once("header.php");
if(!$userid)
{
        header("Location: login.php");
        exit;
}
        $limit = $_REQUEST['limit'];
        if ($limit == "") {
                $limit = 10;
        }
        $start = $_REQUEST['start'];
        if ($start == "") {
                $start = 0;
        }
        $sort = $_REQUEST['sort'];
        if ($sort == "") {
                $sort = "added";
        }
        $tn = $_REQUEST['tn'];
        if ($tn == "") {
                $tn = 0;
        }
        $details = $_REQUEST['details'];
        if ($details == "") {
                $details = 1;
        }

        $totalcount = 0;
        $query = "SELECT count(filename) as ct from images where userid=$userid";       
    $result = mysql_query($query) or die("Query failed 1.");
        while ($line = mysql_fetch_array($result)) {
                        $totalcount = $line[ct];
        }
        mysql_free_result($result);

        $displaystart = $start + 1;
        $displayend = ($start + $limit > $totalcount ? $totalcount : $start + $limit);
        if ($displayend == $totalcount) {
                $nextset = 0;
        } else {
                $nextset = ($totalcount - $displayend > $limit ? $limit: ($totalcount - $displayend));
        }

        if ($details) {
                $query = "select i.filename as filename, i.tn_filename as tn_filename, i.filepath as filepath, i.added as add_dt, i.ip as ip, i.filesize as filesize, sum(ih.kb) as bandwidth, count( ih.filename ) as ctr from images i left outer join imagehits ih on i.filename = ih.filename where i.userid=$userid group by filename order by " . $sort . " desc limit " . $start . "," . $limit;
        } else {
                $query = "select i.filename as filename, i.tn_filename as tn_filename, i.filepath as filepath from images i left outer join imagehits ih on i.filename = ih.filename  where i.userid=$userid group by filename order by " . $sort . " desc limit " . $start . "," . $limit;
        }
       
    $result = mysql_query($query) or die("Query failed 2.");
       
?>
<div id="inhaltbox">
    <h1>Optionen</h1>
<form name="images" id="images" action="<?= $_SERVER['PHP_SELF'] ?>" method="post" style="margin-bottom: 0px;">
        <div align="center" style="color: #000080;">
                Bilder Zeigen: <input type="text" name="limit" value="<?= $limit ?>" size="3" maxlength="4">&nbsp;&nbsp;&nbsp;&nbsp;Sortieren nach: <select name="sort" size="1"><option value="filename" <?= ($sort == "filename" ? "selected" : "") ?>>Image Name</option><option value="added" <?= ($sort == "added" ? "selected" : "") ?>>Datum &amp; Zeit</option><option value="ip" <?= ($sort == "ip" ? "selected" : "") ?>>IP Addresse</option><option value="filesize" <?= ($sort == "filesize" ? "selected" : "") ?>>Datei Gr&ouml;&szlig;e</option><option value="ctr" <?= ($sort == "ctr" ? "selected" : "") ?>>Views</option><option value="bandwidth" <?= ($sort == "bandwidth" ? "selected" : "") ?>>Bandwidth</option></select>&nbsp;&nbsp;&nbsp;&nbsp;Zeige Details: <select name="details" size="1"><option value="1" <?= ($details == "1" ? "selected" : "") ?>>Ja</option><option value="0" <?= ($details == "0" ? "selected" : "") ?>>Nein</option></select>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="btn" value="Zeigen">
</div>
<div id="inhaltbox">
    <h1>Deine Bilder</h1>
    <div class="klappbox">
        <h2>Zeige Bilder <?= $displaystart ?> bis <?= $displayend ?> von <?= $totalcount ?></h2>
        <br />
        <? if ($start > 0) { ?><a style="color: #0000cd;" href="<?= $PHP_SELF ?>?limit=<?= $limit ?>&sort=<?= $sort ?>&start=<?= $start - $limit?>&tn=<?= $tn ?>&details=<?= $details ?>">Previous <?= $limit ?></a> - <? } ?><? if ($nextset > 0) { ?><a style="color: #0000cd;" href="<?= $PHP_SELF ?>?limit=<?= $limit ?>&sort=<?= $sort ?>&start=<?= $start + $limit?>&tn=<?= $tn ?>&details=<?= $details ?>">Next <?= $nextset ?></a><? } ?>
        <table border="0" cellpadding="0" cellspacing="0">
            <tbody><tr valign="top">
                <td align="center" id="<?=$line[filename]?>">
                    <img src="<?=$line[filepath].$line[tn_filename] ?>" border="0"><br />
                    <input type="checkbox" name="chk[]" value="<?= $line[filename] ?>">
                    <p><a href="view-<?= $line[filename] ?>">Bild anzeigen</a></p>
                </td><td style="font-size: 10pt; font-style: italic; padding-left: 25px;">
                    <? if ($details) { ?>
<table border="0">
  <tr>
    <td>Alle Bilder makieren:</td>
    <td><input type="checkbox" onClick="check_all('chk','images')"></td>
  </tr>
  <tr>
    <td>Bildername:</td>
    <td><?=$line[filename]?></td>
  </tr>
  <tr>
    <td>Uploaded</td>
    <td><?= date("d/m/Y h:i:s A", $line[add_dt]) ?></td>
  </tr>
                <?
                                        $band=$line[bandwidth];
                                        $bandwidthmb =  ($band / 1048576) ;       
                                        //$bandwidthmb =  ($band / 1024) ;
                                        $filesizekb =  ($line[filesize] / 1024) ;
                ?>
  <tr>
    <td>Dateigr&ouml;&szlig;e</td>
    <td><?= number_format($filesizekb)?></td>
  </tr>
  <tr>
    <td>Angesehen</td>
    <td><a href="referers.php?limit=<?= $limit ?>&sort=<?= $sort ?>&start=<?= $start ?>&tn=<?= $tn ?>&details=<?= $details ?>&filename=<?= $line[filename] ?>"><?= number_format($line[ctr]) ?>x</a></td>
  </tr>
  <tr>
    <td>Bandwidth M</td>
    <td><?= number_format($bandwidthmb) ?></td>
  </tr>
</table><? $i++;} ?></td>
            </tr>
        </tbody></table>
        <hr>
        <? } else { ?>
                <table border="0" width="100%" cellpadding="2" cellspacing="0">
                        <tr>
                                <?
                                        $ctr = 0;
                                        while ($line = mysql_fetch_array($result)) {
                        $ctr++;
                                ?>
                <td valign="top" align="center"><div id="<?=$line[filename]?>"><a href="view-<?= $line[filename] ?>"><img src="<?=$line[filepath].$line[tn_filename] ?>" border="0"></a><br /><br /><input type="checkbox" name="deleteFN[]" value="<?= $line[filename] ?>"></div></td>
                                <?
                    if ($ctr % 5 == 0) {
                                ?>
            </tr>
            <tr>
                        <?}}?>
                        </tr>
                </table>
                        </div>

        <? }
    mysql_free_result($result);
    mysql_close($link);
        ?>
<br />
        <table border="0" width="100%" cellpadding="2" cellspacing="0">
        <tr bgcolor="#dcdcdc">
                <td align="center" class="cell"><input type="button" name="btn" value="Delete"  onClick="return deleteimage();"></td>
        </tr>
        </table> 
    </div>
    </form>     
    </div>
</div>
<? require_once("footer.php"); ?>


asp2php 25-01-2009 10:31

Bitte Regel: http://www.php-resource.de/forum/sho...threadid=50454 lesen und befolgen :motz:

Ayline 25-01-2009 11:01

Entschuldigung, aber ich kann damit nichts anfangen!

Blackgreetz 25-01-2009 11:49

Mit was genau nicht?

Kurzform:

-Umbrechen
-PHP-Tags nutzen
-nur relevanten Code posten

mfg

pekka 25-01-2009 14:05

Willkommen im Forum!

Als allererstes wie Blackgreetz schon sagt, bitte den Code umbrechen, damit man nicht kilometerlang nach rechts scrollen muß.

Dann geht es um den relevanten Teil. Wir können nicht wissen, wo Zeile 108 ist, die PHP moniert. Von Hand nachzählen will hier niemand.
Such bitte in deinem Editor die betreffende Zeile und poste diese, und 4-5 davor und danach.

Dann hast du gute Chancen, daß dir jemand weiterhilft. :)


Alle Zeitangaben in WEZ +2. Es ist jetzt 01:45 Uhr.

Powered by vBulletin® Version 3.8.2 (Deutsch)
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
[c] ebiz-consult GmbH & Co. KG