ħÊÞÕù°ÔÖ®PHPÉè¼Æģʽ
Ç°ÑÔ£ºÎÒдµÄ¹ØÓÚÉè¼ÆģʽµÄһϵÁÐÎÄÕ¡£ÕâϵÁеÄÎÄÕÂÖ÷ÒªÕë¶Ôû½Ó´¥¹ýÉè¼ÆģʽµÄ£¬»òÕß˵½Ó´¥¹ýµ«»¹²»ÊǺÜÃ÷°×µÄPHPer¡£
ÎÊÌâµÄÌá³ö:
¿ÉÄܺܶàÈ˶¼Ð´¹ýÀ࣬Îļþ²Ù×÷µÄ£¬Êý¾Ý¿âµÄ……
¶ÔÓÚÊý¾Ý¿âµÄÀàÀ´ËµÓÐʱºò¿ÉÄܱ»ºöÂÔµÄÒ»¸öÎÊÌâÊÇ£ºÎÒÃÇ´´½¨ÀàµÄʵÀýʱһ°ã¶¼ÊÇͨ¹ý¹¹Ô캯ÊýÁ¬½ÓÁËÊý¾Ý¿â¡£Õâû´í¡£µ«ÊÇÈç¹ûÎÒÃDz»×¢ÒâµØ´´½¨Á˶à¸öʵÀý£¬ÄÇô¶ÔÓÚÊý¾Ý¿â×ÊÔ´¶øÑÔÊÇÒ»ÖÖÀË·Ñ¡£ËùÒÔʹÓõ¥¼þģʽÔÚ½â¾öÕâ¸öÎÊÌâÉϾÍÏԵúÜÓбØÒªÁË¡£
µ¥¼þģʽµÄ×÷Óãº
´ÓÉÏÃæ¿ÉÒÔ¿´³ö£¬µ¥¼þģʽµÄÒýÈëÊÇΪÁËʹÀàµÄʵÀýÖ»ÓÐÒ»¸ö¡£
ÄÇôÏÂÃ濪ʼÎÒÃǵÄÀàµÄÉè¼Æ¡£ÕâÀï¾Í²»ÒÔÊý¾Ý¿âΪÀý×ÓÁË¡£´Ó±êÌâ¿ÉÒÔºÜÃ÷ÏÔ¿´³ö£¬ÎÒÕâ¸öϵÁеÄÎÄÕ¶¼ÊÇÒÔħÊÞÕù°ÔΪÀý×ӵġ£
ÏëÍæÓÎÏ·£¬ÄÇôÏÈ´ò¿ªÓ¦ÓóÌÐòWarThree£º
<?php
/*
*´´½¨Ò»¸öħÊÞÕù°Ô3µÄÓ¦ÓóÌÐòÀà
*/
class WarThree
{
public function __construct()
{
echo 'Open war3.exe<br/>';
}
}
$war = new WarThree();
//ÕâÑùòËÆûʲôÎÊÌâ¡£µ«Èç¹ûÄ㲻СÐÄ´ò¿ªÁË2¸öħÊÞÕù°ÔÄØ£¿
//³¢ÊÔÏÂÃæÓï¾ä
$war_again = new WarThree();
echo ($war !== $war_again) ? 'Error:War3.exe is already running' : 'Have a good time in the game';
?>
ÏàÐÅÄãÒѾ֪µÀÁËÉÏÃæ´úÂë´æÔÚµÄÎÊÌâÁË¡£
ÄÇô£¬Èç¹ûÎÒÃǶÔÀàµÄʵÀý»¯ÕâÒ»¹ý³Ì½øÐпØÖÆ£¬Ò²¾ÍÊÇ˵²»¸øÓû§Ëæ±ã´ò¿ªÓÎÏ·£¬ÎÒÃÇÒªÔÚ´ò¿ªÖ®Ç°½øÐпØÖÆ¡£
ÊÔÊÔÏÂÃæ´úÂ룺
<?php
/*
*´´½¨Ò»¸öħÊÞÕù°Ô3µÄÓ¦ÓóÌÐòÀà
*·ÀÖ¹ÔÚÍⲿÎÞÏÞ´ò¿ª³ÌÐò
*/
class WarThree
{
//°Ñ¹¹Ô캯Êý¸ÄΪprivateµÄ£¬¿´ÄãÔõô´´½¨ÎÒ£¿ºÇºÇ
private function __construct()
{
echo 'Open war3.exe<br/>';
}
}
$war = new WarThree();//Õâʱ³¢ÊÔ´´½¨¶ÔÏó»á·¢Éú´íÎó¡£
?>
×ܲ»Äܲ»ÈÃÈËÍæÓÎÏ·°É£¬ÄǸɴàжÔØËãÁË!
±ð¼¤¶¯£¬¸ÄϾÍÄÜÍæÁËÂÕæÊǵġ£
<?php
/*
*´´½¨Ò»¸öħÊÞÕù°Ô3µÄÓ¦ÓóÌÐòÀà
*×ÜËã¿ÉÒÔ´ò¿ªÁË
*/
class WarThree
{
//°Ñ¹¹Ô캯Êý¸ÄΪprivateµÄ£¬¿´ÄãÔõô´´½¨ÎÒ£¿ºÇºÇ
private function __construct()
{
echo 'Open war3.exe<br/>';
}
public static function OpenWar()
{
new WarThree();
}
}
$war = new WarThree();//ÎÒ´ò¿ª¡£ß×»¹²»ÐÐ
$war = WarThree::OpenWar();//Â¥Éϵģ¬ÄãÕâ²»·Ï»°Âð¡£ÎÒ»¹ÊÇprivateµÄ¡£²»¹ýͨ¹ýOp
Ïà¹ØÎĵµ£º
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......
ÎÒ·¢ÏֺܶàµÄPHP³ÌÐòÔ±£¬ÓÈÆäÊÇѧϰ»¹²»ÊǺܾõģ¬¶¼²»ÖªµÀPHPµÄ¾«»ªËùÔÚ¡£Perlµ±ÄêÈçºÎÔÚÉ̽ç³öÃû£¿ÆäÇ¿´óµÄÕýÔò±í´ïʽ¡£¶øPHPÄØ£¿ËûÊÇÒ»ÃÅ´ÓUnixÏ·¢Õ¹ÆðÀ´µÄÓïÑÔ£¬µ±È»Ò²¾Í¼Ì³ÐÁËPerlµÄºÜ¶àÌص㣬ͬʱCµÄÓŵ㶼ÓС£¿ìËÙ¡¢¼ò½à¡¢Ã÷ÁË£¬ÓÈÆäÊÇC³ÌÐòÔ±£¬PHPÊÇÖÁ°®£¬ÎÒ¾ÍÊÇÉî°®×Å“PHP”£¨¶¼ÍüÁËÅ®ÓÑÁË:)£©¡ ......
1.PHP×Ö·û´®²Ù×÷³£Óõķ½·¨
php´®Öл¹ÓÐÒ»¸öÌØÊâµÄ»¨À¨ºÅ²Ù×÷·û¡£µ±ÓÃË«ÒýºÅÖ¸¶¨×Ö·û´®Ê±£¬ÆäÖеıäÁ¿»á±»½âÎö¡£ÔÚË«ÒýºÅÖеĴ®ÖÐÈç¹ûÓöµ½$£¬½âÎöÆ÷»á¾¡¿ÉÄܶàµØÈ¡µÃºóÃæµÄ×Ö·ûÒÔ×é³ÉÒ»¸öºÏ·¨µÄ±äÁ¿Ãû£¬Èç¹ûÏë±íʾָ¶¨Ãû×ֵĽáÊø£¬Óû¨À¨ºÅ°Ñ±äÁ¿ÃûÀ¨ÆðÀ´¡£Çë¿´ÒÔÏ´úÂ룺
<?php
$beer = 'heineke ......
ÎÊÌâÃèÊö£ºÒ»¸öÁ¬½ÓÔ¶³ÌÊý¾Ý¿âµÄPHP½Å±¾testdb.php£¬ÔÚä¯ÀÀÆ÷ÖÐÔËÐУºhttp://localhost/testdb.php£¬³öÏÖ´íÎó£ºCan't connect to MySQL server on '10.60.56.220' (13)£¬µ«ÊÇÔÚ±¾µØÓÃphpÃüÁîÐÐÔËÐУºphp testdb.php£¬È´Õý³£µØÁ¬ÉÏÁËÊý¾Ý¿â²¢¶Á³öÁËÆäÖеÄÊý¾Ý¡£
Ó¦ÓóÌÐò»·¾³£º±¾µØIP£º10.60.56.90£¬±¾µØµçÄÔÉÏ°²×°Apache 2 ......