Advertisement
GWibisono

part 1

Oct 5th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?php
  2. //error_reporting(1);
  3. //====JANGAN LUPA DI GANTI ISINYA================
  4. $mysqli = new mysqli("localhost", "root", "", "temp_main");
  5. if(@isset($_GET['act']))$show=$_GET['act'];
  6.  
  7. //=========berikut ini adalah list adminnya============
  8. if(@isset($show) && $show=='admin')
  9. {
  10.  
  11. ?>
  12.  PLEASE WAIT
  13. <?php
  14. }
  15.  
  16. if(!isset($show))
  17. {
  18. ?>
  19. <a href='?act=admin'>Halaman Admin</a>
  20. <h1>BUKU TAMU</h1>
  21. <h2>Oleh G. M. Wibisono</h2>
  22. <?php
  23. $sql="select  * from bukutamu
  24. where stat=1
  25. order by id desc";
  26.     $q=$mysqli->query($sql);
  27.     if(!$q)
  28.     {
  29.         die($mysqli->error);
  30.     }
  31.     if(@ $q->num_row==0)
  32.     {
  33.         echo "<h3>data masih kosong</   h3>";
  34.     }
  35.     while ($row = $q->fetch_assoc())
  36.     {
  37.         $detail=json_decode($row['detail'], true);
  38.     ?>
  39.     <div>
  40.     <h3><?php echo $detail['nama'];?>
  41.     (<?php echo $detail['email'];?>)</h3>
  42.     <h4><?php
  43. /* BUAT KEAMANAN */
  44.     echo strip_tags($row['pesan']);?></h4>
  45.     </div>
  46.     <?php
  47.     }
  48.     ?>
  49.     <a href='?act=admin'>Halaman Admin</a>
  50.     <?php
  51. } //if(!isset($show))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement