Advertisement
ROOT93

pesan_cinta_tampil.php

Apr 11th, 2016
6,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.44 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('koneksi.php');
  4. $awal=0;
  5. $byk_tampil=1;
  6. if(isset($_GET['hal'])){
  7.     $awal=$_GET['hal']*$byk_tampil;
  8. }
  9. $perintah="SELECT*FROM cinta ORDER BY id DESC";
  10. $limit="limit $awal,$byk_tampil";
  11. $per_limit=sprintf("%s %s",$perintah,$limit);
  12. $rsallcinta=@mysql_query($perintah,$koneksi);
  13. $rscinta=@mysql_query($per_limit,$koneksi);
  14. $baris=mysql_num_rows($rsallcinta);
  15. ?>
  16. <html>
  17. <head>
  18. <title>Menampilkan Pesan Cinta</title>
  19. <style type="text/css">
  20. <!--
  21.  
  22. .style11 {
  23.     color: #FFFFFF;
  24.     font-size: 18px;
  25.     background: #FF0000;
  26.     font-weight: bold
  27.    
  28.     }
  29. -->
  30. </style>
  31. </head>
  32. <body>
  33. <table width="750" align="center">
  34. <tr>
  35. <td colspan="3" align="center"><h3>------To Mylove-------</h3></td>
  36. </tr>
  37. </table>
  38.  
  39. <table width="750" align="center" bordercolor="FF0000" cellpadding="2" cellspacing="1" border="1">
  40. <tr>
  41.  
  42. <td width="512" align="center" class="style11">Puisi Mencintaimu Tanpa Mengenalmu</td>
  43.  
  44. </tr>
  45. <?php
  46. $no=$awal+1;
  47. while($data=mysql_fetch_array($rscinta)){
  48.  
  49.     ?>
  50. <tr class="<?php echo $no%2==0?tdc1:tdc2?>">    
  51. <tr>
  52. <td rowspan="2" align="center" valign="top"><?php echo $data['pesan_cinta'];?></td>
  53. </tr>
  54. </tr>
  55.  
  56. <?php $no+=1;}?>
  57. </table>
  58. <center>
  59. <?php
  60. $ke=$_SERVER['PHP_SELF'];
  61. $page=ceil($baris/1);
  62. $pg=1;
  63. while($pg<=$page){
  64.     $hal=$pg-1;
  65.     echo "<a href=\"$ke?hal=$hal\">$pg</a>";
  66.     $pg+=1;
  67. }
  68. ?>
  69. <br/>
  70. Halaman :<?php echo" $hal dari $page";?><br/></center>
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement