Senin, 12 Agustus 2013

PHP Indonesia - Facebook: om ane punya page ketika diklik halaman selanjutny...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
om ane punya page ketika diklik halaman selanjutny...
Aug 12th 2013, 13:31, by Indra Setiawan

Indra Setiawan 1:31pm Aug 12
om ane punya page ketika diklik halaman selanjutnya tidak nampil.
ini script nya.
galeri.php
<?php
include "koneksi.php";

// Tentukan kolom
$col = 3;
$g = mysql_query("SELECT * FROM galeri group by kategori ORDER BY kdgaleri DESC");
echo "<div><table align=center width=900><tr>";
$cnt = 0;
while ($w = mysql_fetch_array($g))
{
if ($cnt >= $col)
{
echo "</tr><tr>";
$cnt = 0;
}

$cnt++;
echo "<td align=center><br />
<a href='?module=detailgaleri&kategori=$w[kategori]' title='$w[kategori]'>
<img alt='$w[kategori]' width=200 height=160 src='../gambar/$w[gambar]' /><br />$w[kategori]</a></td>";
}
echo "</tr></table></div>";

?>
</table>
</td>
</tr>
</body>
</html>

dan ini detailgalerinya.
<?php
include "koneksi.php";

$batas=3;
$halaman=$_GET['halaman'];
if(empty($halaman))
{
$posisi=0;
$halaman=1;
}
else
{
$posisi=($halaman-1)*$batas;
}
// Tentukan kolom
$kategori=$_GET['kategori'];
$col = 3;
$g = mysql_query("SELECT * FROM galeri where kategori='$kategori' ORDER BY kdgaleri DESC LIMIT $posisi,$batas");

echo "<div><table align=center width=900><tr>";
$cnt = 0;
while ($w = mysql_fetch_array($g))
{
if ($cnt >= $col)
{
echo "</tr><tr>";
$cnt = 0;
}

$cnt++;
echo "<td align=center><br />
<a href='../gambar/$w[gambar]' title='$w[deskripsi]' class='pirobox'>
<img alt='$w[deskripsi]' width=200 height=160 src='../gambar/$w[gambar]' /></a><br /></td>";
}
echo "</tr></table></div>";

echo "<br><br><center>halaman:";
$tampil2="select * from galeri where kategori='$kategori'";
$hasil2=mysql_query($tampil2);
$jmldata=mysql_num_rows($hasil2);
$jmlhalaman=ceil($jmldata/$batas);
for($i=1;$i<=$jmlhalaman;$i++)
if($i !=$halaman)
{
echo "<a href=?module=detailgaleri&halaman=$i>$i</a>||";
}
else
{
echo "<b>$i</b>||";
}
?>

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar