PHP IPµØÖ·ºÍÊ®½øÖÆÊý×Ö»¥×ª
IPV4 ¿ÉÒÔ¿´×ö4¸ö256½øÖƵÄÊý×Ö, ¿ÉÒÔ°´³£¹æµÄ½øÖÆת»»»»Ëã³ÉÊ®½øÖÆ.
Èç 192.168.1.1 »»Ëã³É10½øÖÆ:
192*256*256*256 + 168*256*256+1*256+1
Æäʵ¼ÆËã»ú¸üÉó¤ÒÆλºÍÓë»òÔËËã. ¿ÉÒԸĽøËã·¨ÈçÏÂ.
IP ת³¤ÕûÐÍ
public ipToInt($sIP)
{
$aIP = explode('.',$sIP);
$iIP = ($aIP[0] << 24) | ($aIP[1] << 16) | ($aIP[2] << 8) | $aIP[3]
if($iIP < 0) $iIP += 4294967296;
return $iIP;
}
ÕûÐÍת IP:
function intToIP($iIP)
{
$xor = array(0x000000ff,0x0000ff00,0x00ff0000,0xff000000);
for($i=0; $i<4; $i++)
{
${s.$i} = ($iIP & $xor[$i]) >> $i*8;
if (${s.$i} < 0) ${s.$i} += 256;
}
return $s3.'.'.$s2.'.'.$s1.'.'.$s0;
}
Ïà¹ØÎĵµ£º
ÔÎÄÁ´½Ó£ºhttp://www.williamlong.info/archives/1846.html
ÔÚWindows IIS
6.0ÏÂÅäÖÃPHP
£¬Í¨³£ÓÐCGI
¡¢ISAPI
ºÍFastCGI
ÈýÖÖÅäÖ÷½Ê½£¬ÕâÈýÖÖģʽ¶¼¿ÉÒÔÔÚIIS
6.0ϳɹ¦ÔËÐУ¬ÏÂÃæÎҾͽ²Ò»ÏÂÕâÈýÖÖ·½Ê½ÅäÖõÄÇø±ðºÍÐÔÄÜÉϵIJîÒì¡£
¡¡¡¡1¡¢CGI
£¨Í¨ÓÃÍø¹Ø½Ó¿Ú/Common Ga ......
Ò»¸ö¹«Ë¾¼òµ¥µÄÃæÊÔÌ⣺
1. ¼ò´ðÌâ
(1)һЩÏà¹ØLINUX·½ÃæµÄÖ¸Áî²Ù×÷eg: mkdir ´´½¨Ä¿Â¼ touch ´´½¨Îļþ¼ÐÒÔ¼°ÐÞ¸ÄȨÏÞchmodÖ®ÀàµÈµÈ
(2)¼òÊö²»Í¬°æ±¾µÄPHPÓÐʲôÇø±ð,ÊÔ¾ÙÀý¼òÊö.
(3),¼òÊö½Ó¿Ú¼¼ÊõµÄºÃ´¦,ÊÔ¾ÙÀý¼òÊö.
(4)ÈçºÎʹÓÃÏÂÃæµÄÀà,²¢½âÊÍÏÂÃæʲôÒâ˼?
class test{
function ......
1¡¢Ìá½»±íµ¥JavascriptÑéÖ¤
<form action="" method="post" name="myform" onsubmit="return CheckPost();">
SCRIPT language=javascript>
function CheckPost()
{
if (myform.user.value=="")
{
alert("ÇëÌîдÓû§");
myform.user.focus();
return f ......
Output Control º¯Êý¿ÉÒÔÈÃÄã×ÔÓÉ¿ØÖƽű¾ÖÐÊý¾ÝµÄÊä³ö¡£Ëü·Ç³£µØÓÐÓã¬ÌرðÊǶÔÓÚ£ºµ±ÄãÏëÔÚÊý¾ÝÒѾÊä³öºó£¬ÔÙÊä³öÎļþÍ·µÄÇé¿ö¡£Êä³ö¿ØÖƺ¯Êý²»¶ÔʹÓà header() »ò setcookie(), ·¢Ë͵ÄÎļþÍ·ÐÅÏ¢²úÉúÓ°Ïì,Ö»¶ÔÄÇЩÀàËÆÓÚ echo() ºÍ PHP ´úÂëµÄÊý¾Ý¿éÓÐ×÷Óá£
ÎÒÃÇÏȾÙÒ»¸ö¼òµ¥µÄÀý×Ó£¬Èôó¼Ò¶ÔOutput ControlÓÐÒ»¸ö´ ......
Ϊ PHP Ìí¼ÓÀ©Õ¹¿âÊÇÒ»¼þ¼òµ¥µÄÊÂÇé¡£²»¹ýÊ×ÏÈÄã×îºÃ»áÒ»µãµãC/C++±à³Ì¼¼Êõ£¬²¢ÇÒ¶ÔMakefileÓÐÒ»¶¨µÄÁ˽⡣
ÒÔÏÂÊÇÔÚ Linux ϵÄÒ»¸ö¼òµ¥Àý×Ó£º
Ê×ÏÈ£¬½øÈë php Ô´´úÂëĿ¼£¨¼ÙÉèΪ PHP_SRC£¬ÒÔÏÂͬ£©£¬Ê¹Óà php ×Ô´øµÄ ext_skel ¹¤¾ßÉú³ÉÒ»¸öÐÂÀ©Õ¹ mk4php£º
cd PHP_SRC/etc;
./ext_skel --extname=mk4php
Õý³£Ç ......