html代码中意外的文件结尾

时间:2015-06-09 16:44:31

标签: php html tags

这是我的senaraiperalatanstaf.php ..我在中间添加了php代码,但之后它说我有解析错误,这是意外的文件结束。我试过搜索但我找不到错误。请帮忙。非常感谢。这是我的代码。问题是我的整体代码行是98,但错误就是Parse错误:语法错误,C:\ xampp \ htdocs \ beachresort \ senaraiperalatanstaf.php在100行意外结束文件。我不明白。

<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8">
    <title>SENARAI PERALATAN - PENDAFTARAN PERALATAN TD</title>
    <link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
    <div id="background">
        <div id="page">
            <div id="header">
                <div id="logo">
                    <a href="index.html"><img src="images/logooo.jpg" alt="LOGO" height="80" width="80"></a>
                </div>
                <ul id="drop-nav">
                    <ul>
                         <li><a href="STAF UTAMA.html">Utama</a></li>
                         <li><a href="PENDAFTARAN STAF.html">Pendaftaran Staf</a>
                         <li><a href="SENARAI PERALATAN STAF.html">Senarai Peralatan</a>
                         <li><a href="KELUAR STAF.html">Keluar</a>

                    </ul>
                    </ul>
            </div>
            <div id="contents">
                <div class="box">
                    <div>
                        <div class="body">
                            <h3>Senarai Peralatan yang telah didaftarkan : </h3>
                            <p>
                                 <h5><center><p><a href="#">HARTA MODAL</a></p></center></h5>

                                 <p>&#10140; <a href="#">Jentera Berat</a></p>                               
                                 <p> &#10140; <a href="#">Kenderaan</a></p>                              
                                 <p>&#10140; <a href="#">Peralatan</a></p>                              
                                 <p>&#10140; <a href="#">Perubatan</a></p>                               
                                 <p>&#10140; <a href="#">Penyiaran</a></p>
                                 <p>&#10140;<a href="#">Dapur</a></p>
                                 <br>
                                 </p>

                                 <h5><center><p><a href="#">INVENTORI</a></p></center></h5>

                                 <p>
                                 <table border="1" style="width:100%">
                                     <tr>
                                     <td style="width:85px"><center>NO.SIRI</center></td>
                                     <td style="width:85px"><center>KATEGORI</center></td>
                                     <td style="width:85px"><center>SUB KATEGORI</center></td>
                                     <td style="width:85px"><center>HARGA</center></td>
                                     <td style="width:85px"><center>KUANTITI</center></td>
                                     <td style="width:85px"><center>PILIHAN</center></td>

                                     </tr>
                                </table>
                                </p>

                                <?php
                                $sql = "SELECT * FROM `kew.pa-2` ORDER BY no_siri";
                                $no = 1;
                                foreach ($dbh->query($sql) as $data) :
                                ?>

                                     <tr>
                                         <td style="width:85px"><center><?php echo $data['no_siri'] ?></center></td>
                                         <td style="width:85px"><center><?php echo $data['kategori'] ?></center></td>
                                         <td style="width:85px"><center><?php echo $data['sub_kategori'] ?></center></td>
                                         <td style="width:85px"><center><?php echo $data['harga'] ?></center></td>
                                         <td style="width:85px"><center><?php echo $data['kuantiti'] ?></center></td>
                                         <td align="center" style="width: 116px">
                                     </tr>

                                             <a href="senaraiperalatanstaf.php?no_siri=<?php echo $data['no_siri'] ?>"><img alt="edit" src="edit.png" /><a>
                                             &nbsp;&nbsp;
                                             <a href="senaraiperalatanstaf.php?no_siri=<?php echo $data['no_siri'] ?>"><img alt="delete" src="delete.png" /><a>


                                 <p>&#10152; <a href="#">Perabot</a></p>                                 
                                 <p>&#10152; <a href="#">Hiasan</a></p>                              
                                 <p>&#10152; <a href="#">Langsir</a></p>                                
                                 <p>&#10152; <a href="#">Pinggan Mangguk</a></p>                                 
                                 <p>&#10152; <a href="#">Sukan</a></p>


                        </div>
                    </div>
                </div>
            </div>
        </div>
     </div>

    </body>
</html>

1 个答案:

答案 0 :(得分:0)

您没有endforeach来匹配您的foreach。这可能应该在你的</tr>

之后