-3

I have read any question related about this, and the answer said it was because "missing quite a few semicolon". I have checked my code and think that there aren't missing semicolon.. but this problem still happen to me. My friend, with same code with me, not encounter same problem.

Here's my code (line 115 is the </html>) :

<?php
// gunakan variabel session pada halaman ini. 
// fungsi ini harus diletakkan di awal halaman.
session_start();
////// Bagian Logout. Delete variabel session.
if(empty($_SESSION['username']) AND (empty($_SESSION['password']))){
// Re-direct ke index.php
header("location:memberlogin.html");
}
?>

<html>
<head> 
<title>Home</title>

<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- <link href="assets/css/docs.css" rel="stylesheet"> <!-- -->
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.gif" type="image/x-icon"> <!--Mengganti
favicon-->

</head>
<body bgcolor="white">

<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container">
        <ul class="nav">
          <li class="active">
            <a href="home.php">Home</a>
          </li>
          <li class="">
            <a href="produk.php">Products</a>
          </li>
          <li class="">
            <a href="formorder.php">Order</a>
          </li>
        </ul>
    </div>
  </div>
</div>

<div class="bs-docs-example">
<ul>
    <h1><p class="text-center">Profile</p></h1>

        <dl class="dl-horizontal">
                    <dt>Nama</dt>
                    <dd><?php
                        include "connect.php";
                        $user=$_SESSION['username'];
                        $query = $con->prepare("select *
from member where username='$user'");
                        $query->execute();
                        $niplama=$query->fetch();
                        echo $niplama['nama'];
                        ?>              
                    </dd>

                    <dt>NIP</dt>
                    <dd><?php
                        echo $niplama['nip_lama'];
                        echo " / ";
                        echo $niplama['nip_baru'];
                        ?>              
                    </dd>


        </dl>
        <h4><p class="text-left">Web Service List :</p></h4>
        <table class="table">
            <thead>
                <tr>
                    <th>No</th>
                    <th>Name</th>
                    <th>Detail</th>
                    <th>Keterangan</th>
                    <th>Status</th>
                    <th></th>
                </tr>
            </thead>
<?php
include "connect.php";
$user = $_SESSION['username'];
$id_user=$con->prepare("select id from member where username='$user'");
$id_user->execute();
$ini = $id_user->fetch();
$id1 = $ini['id'];

$query2 = $con->prepare("select * from web_service where id_pemesan='$id1'");
$query2->execute();

?>
            <tbody>
            <?php 
            $nmr = 1;
            while($service = $query2->fetch()){?>
                <tr>
                    <td><?php echo $nmr; $nmr++;?></td>
                    <td><?php echo $service['kode']?></td>
                    <td><?php echo $service['nama']?></td>
                    <td><?php echo $service['deskripsi']?></td>
                    <td><?php echo $service['status']?></td>
                    <td><a href="webservice.php?kirim_id_ws=<?
php echo $service['id']?>">Lihat</a></td>
                </tr>
            <?}?>
            </tbody>
        </table>

</ul>
</div>


</body>

</html>
machmum
  • 49
  • 1
  • 15
  • "missing quite a few semicolon" --- you weren't attentive enough (or you're trying to cheat saying untruth). I have opened random questions and the reason in the answer was about another missed element. – zerkms Jul 15 '13 at 03:41

4 Answers4

1

Remove the line break inbetween <? and php starting line 105.

rebroken
  • 603
  • 4
  • 9
1

check this code , I saw a error in line 105, error is you wrote php starting tag like this

<? php

That space was the error, I fixed it:

<?php
// gunakan variabel session pada halaman ini. 
// fungsi ini harus diletakkan di awal halaman.
session_start();
////// Bagian Logout. Delete variabel session.
if(empty($_SESSION['username']) AND (empty($_SESSION['password']))){
// Re-direct ke index.php
header("location:memberlogin.html");
}
?>

<html>
<head> 
<title>Home</title>

<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- <link href="assets/css/docs.css" rel="stylesheet"> <!-- -->
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.gif" type="image/x-icon"> <!--Mengganti
favicon-->

</head>
<body bgcolor="white">

<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container">
        <ul class="nav">
          <li class="active">
            <a href="home.php">Home</a>
          </li>
          <li class="">
            <a href="produk.php">Products</a>
          </li>
          <li class="">
            <a href="formorder.php">Order</a>
          </li>
        </ul>
    </div>
  </div>
</div>

<div class="bs-docs-example">
<ul>
    <h1><p class="text-center">Profile</p></h1>

        <dl class="dl-horizontal">
                    <dt>Nama</dt>
                    <dd><?php
                        include "connect.php";
                        $user=$_SESSION['username'];
                        $query = $con->prepare("select *
from member where username='$user'");
                        $query->execute();
                        $niplama=$query->fetch();
                        echo $niplama['nama'];
                        ?>              
                    </dd>

                    <dt>NIP</dt>
                    <dd><?php
                        echo $niplama['nip_lama'];
                        echo " / ";
                        echo $niplama['nip_baru'];
                        ?>              
                    </dd>


        </dl>
        <h4><p class="text-left">Web Service List :</p></h4>
        <table class="table">
            <thead>
                <tr>
                    <th>No</th>
                    <th>Name</th>
                    <th>Detail</th>
                    <th>Keterangan</th>
                    <th>Status</th>
                    <th></th>
                </tr>
            </thead>
<?php
include "connect.php";
$user = $_SESSION['username'];
$id_user=$con->prepare("select id from member where username='$user'");
$id_user->execute();
$ini = $id_user->fetch();
$id1 = $ini['id'];

$query2 = $con->prepare("select * from web_service where id_pemesan='$id1'");
$query2->execute();

?>
            <tbody>
            <?php 
            $nmr = 1;
            while($service = $query2->fetch()){?>
                <tr>
                    <td><?php echo $nmr; $nmr++;?></td>
                    <td><?php echo $service['kode']?></td>
                    <td><?php echo $service['nama']?></td>
                    <td><?php echo $service['deskripsi']?></td>
                    <td><?php echo $service['status']?></td>
                    <td><a href="webservice.php?kirim_id_ws=<?php echo $service['id']?>">Lihat</a></td>
                </tr>
            <?}?>
            </tbody>
        </table>

</ul>
</div>


</body>

</html>
gayan
  • 212
  • 1
  • 3
1
      <td><a href="webservice.php?kirim_id_ws=
      <?php echo $service['id']?>">Lihat</a></td>
      </tr>
        <?}?>

please change it as

    <?php } ?>

and leave some space before all php end tags.

Bharu
  • 191
  • 1
  • 3
  • 19
0
        <?}?>
        </tbody>

You forgot the php after ?

meda
  • 45,103
  • 14
  • 92
  • 122