PHP»ñÈ¡¿Í»§¶Ë¡¢·þÎñÆ÷ÐÅÏ¢
·þÎñÆ÷±äÁ¿ $_SERVER Ïê½â£º
1¡¢$_SESSION['PHP_SELF'] -- »ñÈ¡µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû
2¡¢$_SERVER['SERVER_PROTOCOL'] -- ÇëÇóÒ³ÃæʱͨÐÅÐÒéµÄÃû³ÆºÍ°æ±¾¡£ÀýÈ磬“HTTP/1.0”¡£
3¡¢$_SERVER['REQUEST_TIME'] -- ÇëÇó¿ªÊ¼Ê±µÄʱ¼ä´Á¡£´Ó PHP 5.1.0 ÆðÓÐЧ¡£ºÍtimeº¯ÊýЧ¹ûÒ»Ñù¡£
4¡¢$_SERVER['argv'] -- ´«µÝ¸ø¸Ã½Å±¾µÄ²ÎÊý¡£ÎÒÊÔÁËÏ£¬get·½·¨¿ÉÒԵõ½$_SERVER['argv'][0]£»post·½·¨ÎÞ·¨¸øËû¸³Öµ¡£
5¡¢$_SERVER['SERVER_NAME'] -- ·µ»Øµ±Ç°Ö÷»úÃû¡£
6¡¢$_SERVER['SERVER_SOFTWARE'] -- ·þÎñÆ÷±êʶµÄ×Ö´®£¬ÔÚÏìÓ¦ÇëÇóʱµÄÍ·ÐÅÏ¢Öиø³ö¡£ ÈçMicrosoft-IIS/6.0
7¡¢$_SERVER['REQUEST_METHOD'] -- ·ÃÎÊÒ³ÃæʱµÄÇëÇó·½·¨¡£ÀýÈ磺“GET”¡¢“HEAD”£¬“POST”£¬“PUT”¡£
8¡¢$_SERVER['QUERY_STRING'] -- ²éѯ£¨query£©µÄ×Ö·û´®£¨URL ÖеÚÒ»¸öÎʺŠ? Ö®ºóµÄÄÚÈÝ£©¡£
9¡¢$_SERVER['DOCUMENT_ROOT'] -- µ±Ç°ÔËÐнű¾ËùÔÚµÄÎĵµ¸ùĿ¼¡£ÔÚ·þÎñÆ÷ÅäÖÃÎļþÖж¨Òå¡£ ÈçE:\server
10¡¢$_SERVER['HTTP_ACCEPT'] -- µ±Ç°ÇëÇóµÄ Accept: Í·ÐÅÏ¢µÄÄÚÈÝ¡£
11¡¢$_SERVER['HTTP_ACCEPT_CHARSET'] -- µ±Ç°ÇëÇóµÄ Accept-Charset: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“iso-8859-1,*,utf-8”¡£
12¡¢$_SERVER['HTTP_ACCEPT_ENCODING'] -- µ±Ç°ÇëÇóµÄ Accept-Encoding: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“gzip”¡£
13¡¢$_SERVER['HTTP_ACCEPT_LANGUAGE'] -- µ±Ç°ÇëÇóµÄ Accept-Language: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“en”¡£
14¡¢$_SERVER['HTTP_CONNECTION'] -- µ±Ç°ÇëÇóµÄ Connection: Í·ÐÅÏ¢µÄÄÚÈÝ¡£ÀýÈ磺“Keep-Alive”¡£
15¡¢$_SERVER['HTTP_HOST'] -- µ±Ç°ÇëÇóµÄ Host: Í·ÐÅÏ¢µÄÄÚÈÝ¡£
16¡¢$_SERVER['HTTP_REFERER'] -- Á´½Óµ½µ±Ç°Ò³ÃæµÄÇ°Ò»Ò³ÃæµÄ URL µØÖ·¡£
17¡¢$_SERVER['HTTP_USER_AGENT'] -- ·µ»ØÓû§Ê¹ÓõÄä¯ÀÀÆ÷ÐÅÏ¢¡£Ò²¿ÉÒÔʹÓà get_browser() µÃµ½´ËÐÅÏ¢¡£
18¡¢$_SERVER['HTTPS'] -- Èç¹ûͨ¹ýhttps·ÃÎÊ£¬Ôò±»ÉèΪһ¸ö·Ç¿ÕµÄÖµ£¬·ñÔò·µ»Øoff.
19¡¢$_SERVER['REMOTE_ADDR'] -- ÕýÔÚä¯ÀÀµ±Ç°Ò³ÃæÓû§µÄ IP µØÖ·¡£
20¡¢$_SERVER['REMOTE_HOST'] -- ÕýÔÚä¯ÀÀµ±Ç°Ò³ÃæÓû§µÄÖ÷»úÃû¡£·´ÏòÓòÃû½âÎö»ùÓÚ¸ÃÓû§µÄ REMOTE_ADDR¡£Èç±¾µØ²âÊÔ·µ»Ø127.0.0.1
21¡¢$_SERVER['REMOTE_PORT'] -- Óû§Á¬½Óµ½·þÎñÆ÷ʱËùʹÓõĶ˿ڡ£ÎÒÔÚ±¾»ú²âÊÔûͨ¹ý£¬²»ÖªµÀʲôÔÒò¡£
22¡¢$_
Ïà¹ØÎĵµ£º
1¡¢°²×°libeven
memcachedµÄʹÓÃÐèÒªlibevenµÄÖ§³Ö£¬ÎÒÃǵÃÏÈ×°ÉÏlibeven¡£
¹Ù·½ÍøÕ¾£ºhttp://www.monkey.org/~provos/libevent/
libevent°²×°·½Ê½±È½Ï¼òµ¥:
./configure && make
make install
¼ì²éÊÇ·ñ ÒѾ°²×°
ls -l /usr/local/lib/ | grep even
2¡¢°²×°memcached
¹Ù·½ÍøÕ¾£ºhttp://ww ......
Èç¹ûËùÓеÄClass¶¼Ó¦¸Ã´æÔÚÓÚÒ»¸öĬÈϵIJ㼶ÖеĻ°£¬ÄÇô×²ãÓ¦¸ÃÊÇ×îΪһ°ãµÄClass£¬Ò²¾ÍÊÇ˵¼«Îª³éÏóµÄ£¬Ã¿Ò»¸öϲãµÄClass¾ù±ÈÆäÉϲã
µÄClass£¨¼´¸¸Àࣩ¸ü¼ÓרÃÅ»¯¡£»ùÓÚ¸Ã˼Ï룬ÔÚPHPÖУ¬Õâ¸ö¶¥²ãµÄClass±»ÃüÃûΪ“stdClass”£¬ÇÒ×÷Ϊһ¸ö“Standard
Class”£¬Äã¿ÉÒÔ°ÑËü¿´³ÉÊÇÒ ......
ÓÃPHPдһ¸ö×Ô¼ºµÄÄ£°åÒýÇæ
2009-07-11 09:51
SmartyÒ»Ö±±»ÈËÊÓΪÊǶàÓàµÄ¶«Î÷£¬ÎÒ¾õµÃÈÏΪSmarty¶àÓàµÄÈ˲ÅÊǶàÓàµÄ....²»ËµÕâЩÁË¡£½ñÌìÎҾͽ̴ó¼Òд¸öÄ£°åÒýÇ棬Èôó¼Ò¶¼¿ÉÒÔдһ¸öÊôÓÚ×Ô¼ºµÄÄ£°åÒýÇ棬¶øÇÒ¿´ÍêÕâƪÎÄÕÂÖ®ºó£¬Äã¶ÔSmartyµÄÈÏʶ»á¸ü½øÒ»²½µÄ¡£ÎÒµÄÄ£°åÒýÇæÃû½ÐStupid£¨"ɵ¹Ï"µÄÒâ˼£©£¬ÎÒ²»Ï ......
PHP³ÌÐòÔ±µÄÊ®¸ö½¨ÒéÐÔ¼¼ÇÉ
2009-07-11 09:46
Ò»¸öͬÑùµÄ¹¦ÄÜ,¸÷ÖÖ³ÌÐòÓïÑÔ´ó¶àÄÜʵÏÖ.¾ÍËãÒ»ÖÖÓïÑÔ,Ò²ÓкܶàÖÖʵÏÖ·½·¨.¸÷ÖÖ·½·¨¸÷Óи÷µÄºÃ»µ.
¶ÔÓÚPHP
±È½Ï³£¼ûµÄ¼¸¸ö³ÌÐòʹÓÃÎÊÌâ.±¾ÎÄ×ܽáһЩPHP³ÌÐòÔ±µÄÊ®¸ö½¨ÉèÓë¼¼ÇÉ,¹©´ó¼Ò²Î¿¼.
¡¡¡¡1.ʹÓà ip2long() ºÍ ......
function get_web_page( $url )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page ·µ»ØÍøÒ³
CURLOPT_HEADER => false, // ²»·µ»ØÍ·ÐÅÏ¢
CURLOPT_FOLLOWLOCATION => true, ......