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

phpͳ¼ÆIPÒÔ¼°ÔÚÏßÈËÊýµÄͳ¼Æ

    1.ÓÃJSµ÷ÓÃÎļþcount.php  ÔÚÄãÐèÒª¼ÓÈëͳ¼ÆµÄµÄµØ·½¼ÓÈë<script src="count.php"></script>  ʵ¼ÊÔËÓÃÖÐ×¢ÒâÐ޸ķ¾¶£¡
  
     2.php»·¾³±ØÐëÖ§³Öputenv()º¯Êý,¿ÉÒÔͳ¼Æ×òÈÕ·ÃÎÊ£¬½ñÈÕ·ÃÎÊ£¬ÔÚÏßÈËÊý,Äú·ÃÎʵĴÎÊý¡£
    3 . ÔÚcount.phpÏàͬĿ¼½¨Á¢ÒÔÏÂÎļþ  count,temp,online,н¨Îı¾Îĵµcount.txt È»ºóÈ¥µôÀ©Õ¹Ãû¾ÍÊÇÎļþcountÁË£»Èç¹ûÊÇLinuxÖ÷»úÇë°ÑÕâÈý¸öÎļþÊôÐÔÉèΪ777.
count.phpÎļþ´úÂë:
<?
$file             = "count"; // ¼ÇÊýÎļþÃû³Æ
$startno          = "1000";   // ÆðʼÊýÖµ
$tempfile         = "temp"; 
$t_now   = time();
$t_array = getdate($t_now);
$day     = $t_array['mday'];
$mon     = $t_array['mon'];
$year    = $t_array['year'];
if (file_exists("$file")) {
        $count_info=file("$file");
        $c_info = explode(",", $count_info[0]);
        $total_c=$c_info[0];
        $yesterday_c=$c_info[1];
        $today_c=$c_info[2];
        $lastday=$c_info[3];
} else {
        $total_c="$startno";
        $yesterday_c="0";
        $today_c="0";
        $lastday="0";
}
if ( !isset($HTTP_COOKIE_VARS["countcookie"]) || $HTTP_COOKIE_VARS["countcookie"] != $day) {
        $your_c=1;
        $lockfile=fopen("temp","a");
        flock($lockfile,3);
        putenv


Ïà¹ØÎĵµ£º

ʹÓÃWAMP5´î½¨Apache+MySQL+PHP»·¾³

 Ä¿Ç°Óв»ÉÙAMP£¨Apache\MySQL\PHP£©µÄ¼¯³ÉÈí¼þ£¬¿ÉÒÔÈÃÎÒÃÇÒ»´Î°²×°²¢ÉèÖúá£Õâ¶ÔÓÚ²»ÊìϤAMPµÄÓû§À´Ëµ£¬ºÃ´¦¶à¶à¡£
Ò»¡¢Ê¹ÓÃAMP¼¯³ÉÈí¼þµÄÓŵ㣺
1¡¢¿É±ÜÃâÓÉÓÚȱ·¦AMPµÄ֪ʶ£¬¶øÎÞ·¨ÕýÈ·ÉèÖû·¾³£»
2¡¢¿É¿ìËÙ°²×°²¢ÉèÖúÃAMP»·¾³£¬ÈÃÎÒÃÇÖ±½Ó¿ªÊ¼ÕæÕý¸ÐÐËȤµÄÈí¼þ£¬Èçxoops£»
3¡¢¿É·½±ãµÄ´î½¨²âÊÔ»·¾³£¬¶ÔÓÚ² ......

PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ

¡¡¡¡ËäÈ»PHPÊÇWebÓ¦Óÿª·¢ÖÐ×î¹ã·ºÊ¹ÓõĻ·¾³£¬µ«Ëü»¹ÊÇÒ»¶È±»ÈÏΪÎÞÔµÆóÒµ¼¶¿ª·¢¡£InfoQ×éÖ¯ÁËÒ»¸öÐéÄâ×ù̸С×éÀ´ÌÖÂÛÓïÑÔ/ƽ̨µÄÑݱ估PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ¡£
¡¡¡¡Zeev Suraski£¬Zend Technologies¹«Ë¾´´Ê¼ÈË£¬¸Ã¹«Ë¾Ö÷Òª¹Ø×¢PHPµÄ½øÕ¹¡£
¡¡¡¡Rob Nicholson£¬¸ß¼¶¼¼ÊõÑÐÔ±, ÔøÎªIBM±àд¹ý³ÌÐòÉè¼ÆÓïÑÔÔËÐÐʱ¡£
¡¡¡ ......

phpʵÏÖÌæ»»UTF

 ÅúÁ¿È¥³ýBOMµÄ³ÌÐò
function
 replace_utf8bom(
$str
)  
{  
    $charset
[1] = 
substr
(
$str
,0,1);  
    $charset
[2] = 
substr
(
$str
,1,1);  
    $ch ......

PHP»º´æ¼¼Êõ£ºmemcacheº¯ÊýÏê½âÖ®Ò»

Memcacheº¯Êý¿âÊÇÔÚPECL(PHP Extension Community Library)ÖУ¬Ö÷Òª×÷ÓÃÊǴ´óÈÝÁ¿µÄÄÚ´æÊý¾ÝµÄÁÙʱ´æ·ÅÇøÓò£¬ÔÚ·Ö²¼Ê½µÄʱºò×÷ÓÃÌåÏֵķdz£Ã÷ÏÔ£¬·ñÔò²»½¨ÒéʹÓá£
memcacheº¯ÊýËùÓеķ½·¨ÁбíÈçÏ£º
²Î¿¼http://www.php.net/manual/zh/function.Memcache-add.php
Memcache::add - Ìí¼ÓÒ»¸öÖµ£¬Èç¹ûÒѾ­´æÔÚ£¬Ôò·µ»Øf ......

PHP»º´æ¼¼Êõ£ºmemcacheº¯ÊýÏê½âÖ®¶þ

memcache::debug
bool memcache_debug ( bool $on_off )
 
˵Ã÷£º
¿ØÖƵ÷ÊÔ¹¦ÄÜ£¬Ç°ÌáÊÇphpÔÚ±àÒëµÄʱºòʹÓÃÁË-enable-debugÑ¡Ï·ñÔòÕâ¸öº¯Êý²»»áÓÐ×÷Óá£
²ÎÊý£º
$on_off£ºtrue±íʾ¿ªÆôµ÷ÊÔ£¬false±íʾ¹Ø±Õµ÷ÊÔ
·µ»ØÖµ£º
Èç¹ûphpÔÚ±àÒëµÄʱºòʹÓÃÁË-enable-debugÑ¡Ï·µ»Øtrue£¬·ñÔò·µ»Øfalse
Memcache:: ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ