php·ÖÒ³
<?php
//·ÖÒ³
$link=mysql_connect("localhost","root","root");
$db=mysql_select_db("bustest",$link);
$res=mysql_query("select * from info");
//Ò»¹²¶àÉÙÌõ
$count=mysql_num_rows($res);
//ÿҳ5ÌõÐÅÏ¢
$perpage=5;
//Ò»¹²¶àÉÙÒ³
$pagecount=ceil($count/$perpage);
//´«¹ýÀ´µÄÒ³Êý
$pagenum=$_REQUEST['page'];
//ÅжÏ$pagenumÊÇ·ñÓÐÖµ
if(!isset($pagenum)){
$pagenum=1;
}elseif($pagenum>$pagecount){
$pagenum=$pagecount;
}elseif($pagenum<=0){
$pagenum=1;
}
//²éѯ
$sql="select * from info limit ".($pagenum-1)*$perpage.",".$perpage;
$resc=mysql_query($sql);
print("<table border='1'>");
print("<tr><th>ID</th><th>NAME</th></tr>");
while($row=mysql_fetch_array($resc)){
print("<tr><td>");
print $row["id"];
print("</td><td>");
print $row["name"];
print("</td></tr>");
}
print("</table>");
mysql_free_result($resc);
mysql_free_result($res);
mysql_close($link);
print("<a href=".$_SERVER["PHP_SELF"]."?page=".($pagenum+1).">ÏÂÒ»Ò³</a>");
print("<a href=".$_SERVER["PHP_SELF"]."?page=".($pagenum-1).">ÉÏÒ»Ò³</a>");
?>
Ïà¹ØÎĵµ£º
strtotimeº¯ÊýÊÇÒ»¸öºÜºÃµÄº¯Êý,Áé»îµÄÔËÓÃËü,»á¸øÄãµÄ¹¤×÷´øÀ´²»ÉÙ·½±ã.µ«PHPµÄÊÖ²áÖÐÈ´¶Ô´Ëº¯ÊýµÄ²ÎÊýû×÷Ì«¶à½éÉÜ,¶ÔЩº¯ÊýµÄÆäËû½éÉÜÒ²·Ç³£ÉÙ¡£
ÏÈ¿´ÊÖ²á½éÉÜ£º
strtotime — ½«ÈκÎÓ¢ÎÄÎı¾µÄÈÕÆÚʱ¼äÃèÊö½âÎöΪ Unix ʱ¼ä´Á
¸ñʽ£ºint strtotime ( string $time [, int $now ] )
¡¡¡¡±¾º¯ÊýÔ¤ÆÚ½ÓÊÜÒ ......
½â¾öµÄ°ì·¨Óкü¸¸ö£º
µÚÒ»¸öÊÇ£ºstr_split()£¬Õâ¸ö·½·¨ÊÇPHP5¼ÓÈëµÄ¡£
<?php
$str = "Hello Friend";
$arr1 = str_split($str);
$arr2 = str_split($str, 3);
print_r($arr1);
print_r($arr2);
?>
Êä³ö¾ÍÊÇ£º
Array
(
[0] => H
[1] => e
[2] => l
[3] => l
......
OpenX adserver version 2.8.1 and lower is vulnerable to remote code
execution. To be exploited, this vulnerability requires banner / file
upload permissions, such as granted to the 'advertiser' and
'administrator' roles.
This vulnerability is caused by the (insecure) file upload mechanism of
af ......
´ËƪÎÄÕÂ×¼±¸·Ö2¸ö²¿·ÖÀ´½²Êö£º
µÚÒ»²¿·ÖÖ÷ÒªÏêϸ½²ÊöÒ»ÏÂÔõô¹¹½¨Ò»¸öÍê³ÉµÄC++Ó¦ÓÃÀ©Õ¹Ä£¿é£»
µÚ¶þ²¿·ÖÖ÷Òª½²ÊöÔÚPHP¼°Zend¿ò¼ÜÏÂÔõôʹÓÃZend APIºÍC++ÓïÑÔÀ´ÊµÏÖ×Ô¼ºËùÒªµÄ¹¦ÄÜÒÔ¼°ÏîÄ¿µÄ¿ª·¢£»
´ËƪÎÄÕÂËùÔËÓõĻ·¾³ÔÚLinux
2.4.21-4.ELsmp(Red Ha ......