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

²»´íµÄphp·Ö²¼Àà

<?php
function genpage(&$sql,$page_size=10)
{
      global $pages,$sums,$eachpage,$page; //×ÜÒ³Êý£¬×ܼǼ£¬Ã¿Ò³Êý£¬µ±Ç°Ò³
      $page = $_GET["page"];
   if($page ==0)$page =1;
      $eachpage = $page_size;
      $pagesql = strstr($sql," from ");
      $pagesql = "select count(*) as ids ".$pagesql;
      $conn = mysql_query($pagesql) or die(mysql_error());
      if($rs = mysql_fetch_array($conn))$sums = $rs[0];
     
      $pages=ceil($sums/$eachpage);
   if($pages==0)$pages=1;
  
      $startpos = ($page-1)*$eachpage;
      $sql .=" limit $startpos,$eachpage ";
}
//ÏÔʾ·ÖÒ³
function showpage()
{
 global $pages,$sums,$eachpage,$page; //×ÜÒ³Êý£¬×ܼǼ£¬Ã¿Ò³Êý£¬µ±Ç°Ò³£¬ÆäËü²ÎÊý
    $link=$_SERVER['PHP_SELF']; 
 
echo "¼Ç¼".$sums.":".$eachpage."¡¡";
echo "Ò³Êý".$page."/".$pages."¡¡";
$p_head=$page-5;
if($p_head<=0)$p_head=1;   //Ò³ÂëÑ­»·¿ªÊ¼Êý Ç°5¸ö
$p_end=$page+5;
if($p_end>$pages)$p_end=$pages;   //Ò³ÂëÑ­»·½áÊøÊý ºó5¸ö
echo "[<a href=$link?page=1>Ê×Ò³</a>] ";
 for($i=$p_head;$i<=$p_end;$i++)
 {
 if($i!=$page)
  echo "<a href=$link?page=$i>[$i]</a> ";
 else
  echo "<b><strike>[$i]</strike></b> ";
 }
echo " [<a href=$link?page=$pages>Ä©Ò³</a>]";
}
?>


Ïà¹ØÎĵµ£º

PHP

<?php
// open database connection
@ $db = new mysqli($host, $user, $password, $database_name);
if (mysql_connect_error())
{
echo '';
exit;
}
// query
$result = $db->query($sql);
$num_results = $db->num_rows;
// data
$row = $result->fetch_assoc(); // row is array, $row['id' ......

PHPÐòÁл¯Óõ½µÄ¹¹Ô죺__sleep() __wakeup()

ÔÚPHP½øÐÐÐòÁл¯Ê±£¬serialize() ¼ì²éÀàÖÐÊÇ·ñÓÐ __sleep() ,Èç¹ûÓУ¬Ôò¸Ãº¯Êý½«ÔÚÈκÎÐòÁл¯Ö®Ç°ÔËÐС£¸Ãº¯Êý±ØÐë·µ»ØÒ»¸öÐèÒª½øÐÐÐòÁл¯±£´æµÄ³ÉÔ±ÊôÐÔÊý×飬²¢ÇÒÖ»ÐòÁл¯¸Ãº¯Êý·µ»ØµÄÕâЩ³ÉÔ±ÊôÐÔ. ¸Ãº¯ÊýÓÐÁ½¸ö×÷ÓÃ: µÚÒ». ÔÚÐòÁл¯Ö®Ç°,¹Ø±Õ¶ÔÏó¿ÉÄܾßÓеÄÈκÎÊý¾Ý¿âÁ¬½ÓµÈ. µÚ¶þ. Ö¸¶¨¶ÔÏóÖÐÐèÒª±»ÐòÁл¯µÄ³ÉÔ±ÊôÐÔ,È ......

SQLite Tutorial in PHP

 
SQLite Tutorial in PHP
SQLite is an SQL database manager used locally or on a website, and compatible
in particularly with PHP.
Summary
Installing SQLite and creating a database
.
Installing SQLite. Verifying the installation by creating a base.
Creating and using a SQLite tabl ......

[ת]PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È


PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È
 
 
 
±¾ÎÄÖ÷ÒªÊǽéÉÜÔÚ PHP µÄ±à³ÌÖУ¬ÈçºÎÇÉÓÃÊý×éÀ´½µµÍÒò¶à²ãÑ­»·¶øÒýÆðµÄʱ¼ä¸´ÔӶȵÄÎÊÌâ¡£ÌرðÊǵ±³ÌÐòÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»¥Ê±£¬Óô˷½·¨À´ÓÅ»¯ÄãµÄ´úÂ룬½«»á´ø¸øÒâÏë²»µ½µÄЧ¹û¡£
ͨ³£¿ª·¢ÈËÔ±ÔÚд³ÌÐòµÄʱºò£¬ÍùÍùÊÇ°ÑÒѾ­Éè¼ÆºÃ»òÕß¹¹Ë¼ºÃµÄÔËËãÂß¼­£ ......

PHP ÖÐÇÉÓÃÊý×é½µµÍ³ÌÐòµÄʱ¼ä¸´ÔÓ¶È

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ