Advertisement
asimryu

pdf test - index.php

Jun 1st, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. <?php require("dbcon.php"); ?>
  2. <!DOCTYPE html>
  3. <html lang="ko">
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <title>newslist</title>
  7.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  8. </head>
  9. <body>
  10. <table class="table table-bordered table-striped table-condensed">
  11.     <tr>
  12.         <td>번호</td>
  13.         <td>제목</td>
  14.         <td>날짜</td>
  15.         <td>&nbsp;</td>
  16.     </tr>
  17.  
  18.     <?php
  19.         $sql = "select * from news";
  20.         $rs = $db->query($sql);
  21.         foreach($rs as $row){
  22.     ?>
  23.         <tr>
  24.         <td><?php echo $row['id'];?></td>
  25.         <td class="newstitle">
  26.             <a href="<?php echo $row['id'];?>"><?php echo $row['title'];?></a>
  27.         </td>
  28.         <td><?php echo $row['date'];?></td>
  29.         <td>&nbsp;</td>
  30.     </tr>
  31.     <?php } ?>
  32. </table>
  33. <script src="http://code.jquery.com/jquery-latest.js"></script>
  34. <script>
  35.     $(".newstitle > a").click(function(e){
  36.         e.preventDefault();
  37.         var newsid = $(this).attr("href");
  38.         $.get("newsview.php?newsid=" + newsid, function(data){
  39.             alert(data);
  40.         });
  41.     });
  42. </script>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement