Advertisement
asimryu

index.php

Feb 9th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. include("template/header.php");
  3. include("lib/dbcon.php");
  4. ?>
  5. <h2>여기는 메인페이지입니다.</h2>
  6.  
  7. <?php
  8. $sql = "select * from blog order by wdate DESC";
  9. if( $rs = $db->query($sql) ) {
  10. if( $rows = $rs->fetchAll() ) {
  11. foreach( $rows as $row ){
  12. ?>
  13.  
  14. <div class="panel panel-info">
  15. <div class="panel-heading">
  16. <p><strong><?php echo $row['title'];?></strong></p>
  17. <p>
  18. <?php echo $row['username'];?> /
  19. <?php echo $row['wdate'];?>
  20. </p>
  21. </div>
  22. <div class="panel-body">
  23. <?php echo $row['content'];?>
  24. <?php if( $row['upfile'] ){ ?>
  25. <hr>
  26. <?php
  27. if( $info = getimagesize("data/" . $row['upfile']) ) {
  28. $width = $info[0];
  29. $imgwidth = "";
  30. if( $width > 500 ) $imgwidth = " width='500'";
  31. ?>
  32. <p>
  33. <img src="data/<?php echo $row['upfile'];?>"<?php echo $imgwidth;?>>
  34. <p>
  35. <?php } else { ?>
  36. <p>
  37. 첨부파일:
  38. <a href="data/<?php echo $row['upfile'];?>">
  39. <?php echo $row['upfile'];?>
  40. </a>
  41. </p>
  42. <?php } ?>
  43.  
  44.  
  45. <?php } ?>
  46. </div>
  47. </div>
  48.  
  49. <?php
  50. }
  51. }
  52. }
  53. ?>
  54.  
  55. <?php
  56. include("template/footer.php");
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement