Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHP·ÖÒ³·½·¨

$pagesize=10; //ÉèÖÃÿһҳÏÔʾµÄ¼Ç¼Êý
$c("localhost","root",""); //Á¬½ÓÊý¾Ý¿â
$rs=mysql_query("select count(*) from tb_product",$conn); //È¡µÃ¼Ç¼×ÜÊý$rs
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];

//¼ÆËã×ÜÒ³Êý

$pages=intval($numrows/$pagesize);

//ÅжÏÒ³ÊýÉèÖÃ

if (isset($_GET['page'])){
¡¡$page=intval($_GET['page']);
}
else{
¡¡$page=1; //·ñÔò£¬ÉèÖÃΪµÚÒ»Ò³
}
ÍêÕû´úÂë
£¼?php
¡¡$c("localhost","root","");
¡¡//É趨ÿһҳÏÔʾµÄ¼Ç¼Êý
¡¡$pagesize=10;
¡¡mysql_select_db("mydata",$conn);
¡¡//È¡µÃ¼Ç¼×ÜÊý$rs£¬¼ÆËã×ÜÒ³ÊýÓÃ
¡¡$rs=mysql_query("select count(*) from tb_product",$conn);
¡¡$myrow = mysql_fetch_array($rs);
¡¡$numrows=$myrow[0];
¡¡//¼ÆËã×ÜÒ³Êý

¡¡$pages=intval($numrows/$pagesize);
¡¡if ($numrows%$pagesize)
¡¡¡¡$pages++;
¡¡//ÉèÖÃÒ³Êý
¡¡if (isset($_GET['page'])){
¡¡¡¡$page=intval($_GET['page']);
¡¡}
¡¡else{
¡¡¡¡//ÉèÖÃΪµÚÒ»Ò³
¡¡¡¡$page=1;
¡¡}
¡¡//¼ÆËã¼Ç¼ƫÒÆÁ¿
¡¡$offset=$pagesize*($page - 1);
¡¡//¶ÁÈ¡Ö¸¶¨¼Ç¼Êý
¡¡$rs=mysql_query("select * from myTable order by id desc limit $offset,$pagesize",$conn);
¡¡if ($myrow = mysql_fetch_array($rs))
¡¡{
¡¡¡¡$i=0;
¡¡¡¡?£¾
¡¡¡¡£¼table border="0" width="80%"£¾
¡¡¡¡£¼tr£¾



Ïà¹ØÎĵµ£º

php¿ª·¢50¸ö·Ç³£ÓÐÓõŤ¾ß¡¾×ª¡¿

ÕâÀï50¸öÓÐÒæµÄPHP¹¤¾ß£¬¿ÉÒÔ´ó´óÌá¸ßÄãµÄ±à³Ì¹¤×÷£º
µ÷ÊÔ¹¤¾ß
Webgrind
Xdebug
Gubed PHP Debugger
DBG
PHP_Debug
PHP_Dyn
MacGDBp
²âÊÔºÍÓÅ»¯¹¤¾ß
PHPUnit
SimpleTest
Selenium
PHP_CodeSniffer
dBug
PHP Profile Class
Îĵµ¹¤¾ß
phpDocumentor
PHP DOX
°²È«¹¤¾ß
Securimage
£ºÑéÖ¤Â빤¾ß¡£
Scave ......

PHP¸ßÊÖÑø³ÉÃؼ®

ÓÐÖÖ˵·¨£ºPHPÊÇ×î¼òµ¥µÄÍøÕ¾¿ª·¢ÓïÑÔ£¬ÕâÖÖ¹ÛµãÊÇ´íµÄ¡£
ľͷ±È»ýľ¼òµ¥£¬µ«Ä¾½³ºÍº¢×ӵIJî±ðÊÇľ½³ÄÜ°ÑľͷºÍ»ýľ¶¼±ä³É·¿×Ó£¬º¢×ÓÖ»ÄÜ°Ñ»ýľ±ä³É·¿×Ó£¬¶ÔÓÚľͷËûÃÇÖ»ÄÜÔÚÉÏÃæ»­¸ö·¿×Ó¶øÒÑ¡£
PHP¾ÍÏñľͷ£¬²ËÄñÖ»ÄÜÓÃËü×öµã¼òµ¥µÄÊÂÇ飬¸ßÊ־ͻá°ÑËü±ä³ÉÎÞËù²»ÄÜ¡£
¼ÈÈ»PHP¼òµ¥ÓÖÊǸßÊÖìÅÒ«µÄ¶«Î÷£¬ÄÇÔõôѧ²ÅÄܱä³É¸ ......

ÔÚPHPÀï¼ÓÔØmcryptÄ£¿é Smilings

1.ÏÂÔØ°²×°mcrypt
ÏÈÈ¥http://www.sourceforge.netÏÂÔØLibmcrypt,mhash,mcrypt°²×°°ü
2 .ÏÈ°²×°Libmcrypt
#tar -zxvf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make
#make install
˵Ã÷£ºlibmcriptĬÈÏ°²×°ÔÚ/usr/local
3.°²×°mhash
#tar -zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./ ......

PHP bug??global·¢ÏÖµÄÎÊÌâ

ÈçÏÂphp´úÂë
<?php
$type='a';
$target='type';
$a=array(1,2,3);
a($target);
function a($type)
{
    global $$type;
    var_dump($$type);
}
?>
Ô¤¼ÆÊä³öµÄÊÇstring(1)”a”
¿ÉÊǽá¹ûÊÇ
Notice: Undefined variable: a in D:\web\global.php on ......

PHPÊý×éµÄÅÅÐò


×òÌìÉÏ°àµÄʱºò£¬·¢ÏÖgoogle adµÄ¹ã¸æÉÏÓÐÁËÊÕÈ룬µ«ÊÇÏ°ëÖ®ºó¾ÓÈ»·¢ÏÖad±»“0”ÁË¡£È¥ÍøÉϲéÁËÏà¹Ø×ÊÁÏ£¬·¢ÏÖÁËÎÊÌâ¡£
ÄÇôGoogleÊÇÈçºÎÈ·¶¨AdsenseÓû§×ÔÐеã»÷¹ã¸æµÄÄØ£¿
¼Çס£¬¾ÍÔÚÄãÔø¾­×¢²áGoogle AdsenseÓû§µÄʱºò£¬Google¾ÍÖªµÀÄãµÄIPµØÖ·£¬×ÓÍøÒÔ¼°ÄãµçÄÔϵͳµÄÆäËû×ÊÁÏ¡£ÔÚGoogleµÄÊý¾Ý¿âÖÐÒ»Ö±¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ