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

PHP»ñµÃµÄ¿Í»§¶ËºÍ·þÎñÆ÷¶ËIP

¿Í»§¶ËIPÏà¹ØµÄ±äÁ¿
1. $_SERVER['REMOTE_ADDR']; ¿Í»§¶ËIP£¬ÓпÉÄÜÊÇÓû§µÄIP£¬Ò²ÓпÉÄÜÊÇ´úÀíµÄIP¡£
2. $_SERVER['HTTP_CLIENT_IP']; ´úÀí¶ËµÄIP£¬¿ÉÄÜ´æÔÚ£¬¿ÉαÔì¡£
3. $_SERVER['HTTP_X_FORWARDED_FOR']; Óû§ÊÇÔÚÄĸöIPʹÓõĴúÀí£¬¿ÉÄÜ´æÔÚ£¬¿ÉÒÔαÔì¡£
·þÎñÆ÷¶ËIPÏà¹ØµÄ±äÁ¿
1. $SERVER_NAME£¬ÐèҪʹÓú¯Êýgethostbyname()»ñµÃ¡£Õâ¸ö±äÁ¿ÎÞÂÛÔÚ·þÎñÆ÷¶Ë»¹ÊÇ¿Í»§¶Ë¾ùÄÜÕýÈ·ÏÔʾ¡£
2. $HTTP_SERVER_VARS["SERVER_ADDR"]£¬ÔÚ·þÎñÆ÷¶Ë²âÊÔ£º127.0.0.1£¨Õâ¸öÓëhttpd.confÖÐBindAddressµÄÉèÖÃÖµÏà¹Ø£©¡£ÔÚ¿Í»§¶Ë²âÊÔ½á¹ûÕýÈ·¡£
3. $_SERVER['LOCAL_ADDR'] ¡¢$HTTP_SERVER_VARS['LOCAL_ADDR']£¬²âÊÔÖУ¬Î´»ñµÃÈκνá¹û£¨²âÊÔ»·¾³PHP5£©¡£
ÍêÕûµÄ»ñµÃIPÀà
class getIP{
function clientIP(){
$cIP = getenv('REMOTE_ADDR');
$cIP1 = getenv('HTTP_X_FORWARDED_FOR');
$cIP2 = getenv('HTTP_CLIENT_IP');
$cIP1 ? $cIP = $cIP1 : null;
$cIP2 ? $cIP = $cIP2 : null;
return $cIP;
}
function serverIP(){
return gethostbyname($_SERVER_NAME);
}
}
 
$getIP = new getIP();
$clientIp = getIP::clientIP();
$serverIp = getIP::serverIP();
 
echo 'Client IP is ',$clientIp,'<br />';
echo 'Server IP is ',$serverIp,'<br />';


Ïà¹ØÎĵµ£º

ʹÓÃPHPµÄgd¿â³öÏÖÎÊÌâ

ÎÒʹÓÃWAMP5 version 1.7.4°²×°PHP+Apache+MySQL¼¯³É»·¾³£¬ÔÚµ÷ÊÔÒ»¸ö³ÌÐòʱ£¬ÆäÑéÖ¤Âë²»ÄÜÏÔʾ£¬ÊÔÁ˺öà´Î£¬ÐÞ¸ÄÁ˺ܶàµØ·½Ò²Ã»Äܳɹ¦¡£ÒÑ×öºÃµÄÅäÖÃÈçÏ£º
¢ÙÔÚphpinfÒ³ÃæLoaded Configuration FileºóÃæËùÖ¸¶¨µÄphp.iniÖаÑ;extension=php_gd2.dllÇ°ÃæµÄ;È¥µô¡£
¢ÚÖØÆôÁËApache·þÎñÆ÷¡£
     Âé· ......

php json ajax

¡¡»¥ÁªÍøµÄ½ñÌ죬AJAXÒѾ­²»ÊÇʲôİÉúµÄ´Ê»ãÁË¡£ËµÆðAJAX£¬¿ÉÄÜ»áÁ¢¼´ÏëÆðÒòRSS¶øÐËÆðµÄXML¡£XMLµÄ½âÎö£¬¿ÖÅÂÒѾ­²»ÊÇʲôÄÑÌâ
ÁË£¬ÌرðÊÇPHP5£¬´óÁ¿µÄXML½âÎöÆ÷µÄÓ¿ÏÖ£¬Èç×îÇáÁ¿¼¶µÄSimpleXML¡£²»¹ý¶ÔÓÚAJAXÀ´Ëµ£¬XMLµÄ½âÎö¸üÇãÏòÓÚǰ̨Javascript
µÄÖ§³Ö¶È¡£ÎÒÏëËùÓнâÎö¹ýXMLµÄÈË£¬¶¼»áÒòÊ÷ºÍ½Úµã¶øÍ·´ó¡£²»¿É·ñÈÏ£¬X ......

phpÖÐutf 8±àÂëÏÂÓÃÕýÔò±í´ïʽÈçºÎÆ¥Å人×Ö

ÐèÒªÓõÄphpµÄÕý¹æÆ¥Å人×Ö£¬ÔÚÍøÉÏÕÒÁËЩÎÄÕ¿´ÁËÒÔÏ£¬¿´µ½Õâ¸öµÄʱºò¸Ð¾õÕâƪÎÄÕÂдµÄºÜÕæʵ£¬È̲»×¡×ª¹ýÀ´ÁË¡£
Ô­ÎĵØÖ·£ºhttp://hi.baidu.com/comdeng/blog/item/f272362e47ce29564ec226c5.html
ÔÚjavascriptÖУ¬ÒªÅжÏ×Ö·û´®ÊÇÖÐÎÄÊǺܼòµ¥µÄ¡£±ÈÈ磺
var str = "php±à³Ì";
if (/^[\u4e00-\u9fa5]+$/.t ......

½áºÏʹÓÃPHPºÍRSS£¨×ª£©


ÄÚÈÝÕªÒª£ºRSS ¾ÛºÏ×î½ü·Ç³£Á÷ÐУ¬Òò´ËÖÁÉÙ¶Ô RSS ¼°Æ乤×÷·½Ê½ÓÐËùÁ˽âÊÇÒ»Ãû PHP ¿ª·¢ÈËÔ±µÄÆÈÇÐÐèÒª¡£±¾ÎĽéÉÜÁË RSS »ù´¡ÖªÊ¶¡¢RSS ÖÚ¶àÓÃ;ÖеÄһЩÓÃ;¡¢ÈçºÎʹÓà PHP ´ÓÊý¾Ý¿â´´½¨ RSS ÌáÒª£¬ÒÔ¼°ÈçºÎʹÓà XML_RSS Ä£¿é¶ÁÈ¡ÏÖÓÐ RSS ÌáÒª²¢½«Æäת»»Îª HTML¡£
¡¡¡¡Ê²Ã´£¿ÄúûÌý˵¹ý RSS£¿
¡¡¡¡RSS ¾ÛºÏÊÇ×î³£¼ûµÄ ......

PHPÍøÉÏ»¨µê¹ÜÀíϵͳ

  ÍøÉÏ»¨µêϵͳÊÇÓÉEÒ×ÍøÂç(68ws.cn)»ùÓÚphp+mysql¿ª·¢£¬Ô¤ÉèÏÊ»¨,µ°¸â,ÀñÆ·,ÂÌÖ²µÈÉÌÆ·ÀàÐÍ,¾ßÓÐÍøÉ϶©»¨,×ÔÖú¶©»¨µÈÍøÉÏÏÊ»¨ÏúÊÛ³£Óù¦ÄܺÍÍêÉƵÄÉÌÆ·ÀàÐ͹ÜÀí¡¢ÉÌÆ·¹ÜÀí¡¢ÅäËÍÖ§¸¶¹ÜÀí¡¢¶©µ¥¹ÜÀí¡¢»áÔ±·Ö×é¡¢»áÔ±¹ÜÀí¡¢²éѯͳ¼ÆºÍ¶àÏîÉÌÆ·´ÙÏú¹¦ÄÜ¡£ÏµÍ³¾ßÓо²Ì¬HTMLÉú³É¡¢UTF-8¶àÓïÑÔÖ§³Ö¡¢¿ÉÊÓ»¯Ä£°æÒýÇæµÈ¼¼ÊõÌØ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ