现在jquery的应用越来越广泛了,在很多网站的新闻板块都实现了 标签分类 + 无刷新分页 的效果。
我也自己尝试写了一个,效果图如下(样式可以按用户需求自己去整):
<img height="435" alt="" src="http://www.wfuyu.com/uploadfile/phpjc/如果传递了pager参数
if(isset($_GET[‘pager’]) && isset($_GET[‘count’]))
{
echo GetPager($_GET[‘count’],$_GET[‘pager’]);
}
else
{
echo "没有传入参数!";
}
function GetPager($count,$pager)
{
$begin = 开始时间;
$end = 结束时间;
$rs=mysql_query("SELECT * FROM 数据表 WHERE (pubdate BETWEEN $begin AND $end) ORDER BY pubdate DESC limit ".($pager-1)*$count.",".$count);
while ($r=mysql_fetch_assoc($rs))
{
$temp[]=$r;
}
$html_string="<table cellpadding=’0′ border=’0′ align=’center’ width=’400′ style=’ padding: 8px 4px 1px 10px; ‘ cellpacing=’0’>";
foreach($temp as $k=>$v)
{
//假设 url字段为链接地址,title为新闻标题,pubdate为发表时间
$html_string.=" <tr height=’22’><td valign=’middle’ width=’*’ class=’tt2′><img align=’middle’ alt=’*’ src=’/images/bullet.gif’/> <a target=’_blank’ href=’".$v[‘url’]."’>".$v[‘title’]."</a></td><td align=’right’ width=’100′>".$v["pubdate"]."</td></tr>";
}
$html_string.="</table>";
//这个是新闻读取的数量,不建议读取太多
$num=40;
//新闻的总页数取整
$num_string=ceil($num/$count);
//这里用键值对的方式 返回JSON格式的数据,0为新闻总页数,1为拼接的HTML新闻页面
$arr=array("0"=>$num_string, "1"=>$html_string);
$jarr=json_encode($arr);
echo $jarr;
}
?>
转自:http://www.cnblogs.com/tianxin2001x/
波比源码 » php+jQuery实现新闻标签分类和无刷新分页
order levofloxacin 500mg pills generic levofloxacin 250mg
isotretinoin 40mg for sale accutane 40mg oral buy generic azithromycin 500mg
indomethacin over the counter terbinafine cost trimox 250mg drug
order generic anastrozole Generic viagra usa sildenafil australia
buy olmesartan without prescription order olmesartan without prescription buy acetazolamide generic
cost dapsone 100 mg buy aceon 4mg sale oral aceon
zithromax price order prednisolone for sale generic gabapentin 800mg
buy sildenafil generic brand sildenafil cheap lisinopril 10mg
order generic metoprolol levitra pills buy vardenafil sale
buy generic levitra purchase levitra medrol order online
buy zocor 10mg for sale order propecia 1mg sale finasteride drug
cephalexin pills erythromycin 500mg uk erythromycin 250mg pill
brand sildenafil 50mg cheap tadalafil generic tadalafil 5mg us
sildenafil citrate buy lamictal 50mg online cheap lamotrigine
buy prednisone 40mg online cheap buy deltasone 20mg pill buy amoxicillin 250mg for sale
buy generic prednisone 5mg mebendazole 100mg usa vermox tablet
buy generic spiriva oral spiriva 9mcg terazosin 5mg sale
order pioglitazone 15mg pill order viagra 50mg online viagra 100mg uk
ivermectin 3mg price amantadine canada order avlosulfon 100mg online cheap
slot casino write my essay help websites to write essays
cheap paper writing services purchase sulfasalazine generic sulfasalazine 500 mg usa
benicar 20mg pill buy verapamil 120mg without prescription order divalproex 500mg without prescription
buy diamox 250mg for sale isosorbide brand purchase azathioprine pill
temovate canada brand amiodarone 100mg buy amiodarone
cost lanoxin 250mg buy molnupiravir 200 mg online molnunat cost
coreg 25mg for sale buy carvedilol 6.25mg pill elavil price
buy famotidine pill famotidine order online purchase remeron generic
doxycycline 200mg cheap medrol ca medrol 4mg over counter
ropinirole 2mg price labetalol over the counter order trandate online cheap
buy generic metformin order generic metformin oral tamoxifen
purchase modafinil without prescription generic phenergan order promethazine 25mg
purchase prednisone without prescription order prednisone 20mg for sale amoxil usa
sildenafil 50mg cheap propecia 1mg canada order propecia 5mg for sale
ondansetron pills bactrim canada bactrim online order
accutane medication azithromycin 500mg pill azithromycin usa
purchase modafinil pill metoprolol sale order metoprolol pill
order imuran 25mg for sale naproxen 250mg usa naproxen 500mg drug