Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('koneksi.php');
- $awal=0;
- $byk_tampil=1;
- if(isset($_GET['hal'])){
- $awal=$_GET['hal']*$byk_tampil;
- }
- $perintah="SELECT*FROM cinta ORDER BY id DESC";
- $limit="limit $awal,$byk_tampil";
- $per_limit=sprintf("%s %s",$perintah,$limit);
- $rsallcinta=@mysql_query($perintah,$koneksi);
- $rscinta=@mysql_query($per_limit,$koneksi);
- $baris=mysql_num_rows($rsallcinta);
- ?>
- <html>
- <head>
- <title>Menampilkan Pesan Cinta</title>
- <style type="text/css">
- <!--
- .style11 {
- color: #FFFFFF;
- font-size: 18px;
- background: #FF0000;
- font-weight: bold
- }
- -->
- </style>
- </head>
- <body>
- <table width="750" align="center">
- <tr>
- <td colspan="3" align="center"><h3>------To Mylove-------</h3></td>
- </tr>
- </table>
- <table width="750" align="center" bordercolor="FF0000" cellpadding="2" cellspacing="1" border="1">
- <tr>
- <td width="512" align="center" class="style11">Puisi Mencintaimu Tanpa Mengenalmu</td>
- </tr>
- <?php
- $no=$awal+1;
- while($data=mysql_fetch_array($rscinta)){
- ?>
- <tr class="<?php echo $no%2==0?tdc1:tdc2?>">
- <tr>
- <td rowspan="2" align="center" valign="top"><?php echo $data['pesan_cinta'];?></td>
- </tr>
- </tr>
- <?php $no+=1;}?>
- </table>
- <center>
- <?php
- $ke=$_SERVER['PHP_SELF'];
- $page=ceil($baris/1);
- $pg=1;
- while($pg<=$page){
- $hal=$pg-1;
- echo "<a href=\"$ke?hal=$hal\">$pg</a>";
- $pg+=1;
- }
- ?>
- <br/>
- Halaman :<?php echo" $hal dari $page";?><br/></center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement