我的链接分页不起作用 [英] my link paging doen't work
本文介绍了我的链接分页不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有脚本分页,我想当我点击我的链接时,它会转到下一页,这是我的链接。它工作正常
index.php
< 表 >
< tr >
< th > 否< / th >
< th > 事件< / th >
< th > Tanggal < / th >
< / tr >
<? php
$ batas = 5 跨度>;
$ halaman = $ _GET [' halaman 跨度>];
if(empty($ halaman)){
$ posisi = 0 ;
$ halaman = 1 ;
}
其他 {
$ posisi =($ halaman- 1)* $ batas ;
}
$ tampil = < span class =code-string> select * from ja_events LIMIT $ posisi,$ batas;
$ hasil = mysql_query($ tampil);
$ no = 1;
while ($ data = mysql_fetch_array($ hasil)){
echo < span class =code-string> < tr>< td> $ no< / td>
< td> $ data [nevent ]< / td>
< td> $ data [tglevent]< / td>< / tr>;
$ no ++;
}
echo < ; /表>跨度>;
$ tampil2 = mysql_query( select * from ja_events);
$ jmldata = mysql_num_rows($ tampil2);
$ jmlhalaman = ceil($ jmldata / $ batas);
echo < br>哈拉曼:;
for ($ i = 1; $ i< = $ jmlhalaman; $ i ++)
if ($ i!= $ halaman){
echo < a href = $ _ SERVER [PHP_SELF]?halaman = $ i> $ i < / / span> a > | ;
}
else {
echo $ i | ;
}
echo < p > 总事件: $ jmldata event < / p > ;
?>
之前
echo < a href = $ _ SERVER [PHP_SELF]?halaman = $ i> $ i < / a > | ;
但在我修改之后,它无法工作
.. /module/event.php
.............我改变了...模块= viewevent
echo < a href = index.php?module = viewevent?halaman = $ i ; >
thx ..最好的问候:D
解决方案
batas = 5 ;
halaman =
_GET [' halaman'];
if(空(
hiii,,, i need u're help
i have script paging and i want when i click my link , it wil move to the next page, this is my link. it is work properly
index.php
<table>
<tr>
<th>No</th>
<th>Event</th>
<th>Tanggal</th>
</tr>
<?php
$batas = 5;
$halaman = $_GET['halaman'];
if(empty($halaman)){
$posisi = 0;
$halaman = 1;
}
else {
$posisi = ($halaman-1) * $batas;
}
$tampil = "select * from ja_events LIMIT $posisi,$batas";
$hasil=mysql_query($tampil);
$no=1;
while ($data=mysql_fetch_array($hasil)){
echo "<tr><td>$no</td>
<td>$data[nevent]</td>
<td>$data[tglevent]</td></tr>";
$no++;
}
echo "</table>";
$tampil2 = mysql_query("select * from ja_events");
$jmldata = mysql_num_rows($tampil2);
$jmlhalaman= ceil ($jmldata/$batas);
echo "<br>Halaman : ";
for ($i=1; $i<=$jmlhalaman; $i++)
if ($i !=$halaman){
echo "<a href =$_SERVER[PHP_SELF]?halaman=$i">$i</a> | ";
}
else {
echo"$i | ";
}
echo "<p>Total Event : $jmldata event </p>";
?>
before
echo "<a href =$_SERVER[PHP_SELF]?halaman=$i">$i</a> | ";
but after i modified, it does'nt work
../module/event.php
............. i change becaming ... module=viewevent
echo "<a href="index.php?module=viewevent?halaman=$i" ; >
thx.. best regards :D
解决方案
batas = 5;
halaman =
_GET['halaman']; if(empty(
这篇关于我的链接分页不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文