Guest User

single.php

a guest
May 28th, 2016
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. require_once "view/header.php";
  3. require_once "core/init.php";
  4.  
  5. $error = '';
  6. $id = $_GET['id'];
  7.  
  8. if(isset($_GET['id'])){
  9. $article = tampilkan_per_id($id);
  10. while($row=mysqli_fetch_assoc($article)){
  11. $judul_awal =$row['judul'];
  12. $konten_awal =$row['isi'];
  13. $tag_awal =$row['tag'];
  14. }else{
  15. header ('location:index.php');//jika link sudah dihapus akan redirect ke index "tapi ini gagal"
  16. }
  17. }
  18. ?>
  19.  
  20. <p id="judul_single">
  21. <?=$judul_awal; ?>
  22. </p>
  23.  
  24. <p id="isi_single">
  25. <?=$konten_awal; ?>
  26. </p>
  27.  
  28. <p id="tag_single">
  29. <?=$tag_awal; ?>
  30. </p>
  31.  
  32.  
  33. <?php
  34. require_once "view/footer.php";
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment