PHPº¯Êý°´ÒýÓô«µÝµÄÀý×Ó
PHPº¯Êý°´ÒýÓô«µÝµÄÀý×Ó
Ê×ÏÈÈÃÎÒÃÇÀ´¿´Ò»¶Î´úÂëÈçÏ£º
<?php
$cost=20.99;
$tax=0.75;
function calculateCost(&$cost,$tax){
$cost=$cost+($cost*$tax);
$tax+=4;
}
calculateCost($cost,$tax);
printf("Tax is:%1.2f<br />",$tax);
printf("Cost is:%1.2f",$cost);
?>
Õâ¶Î´úÂëÊ×ÏÈÔÚº¯ÊýcalculateCostµÄÍⲿ¶¨ÒåÁËÁ½¸ö±äÁ¿£º$costºÍ$tax£¬È»ºóÔÚº¯ÊýÄÚ²¿¶ÔÕâ¸ö±äÁ¿Öµ½øÐÐÁËÏàÓ¦µÄÐ޸ģº
$cost=$cost+($cost*$tax); $tax+=4;½ÓÏÂÀ´¾ÍÊǵ÷ÓÃÁ˺¯ÊýcalculateCost($cost,$tax);Æäprintf(”Tax is:%1.2f
“,$tax);¸ñʽ»¯Êä³öÁ˺¯ÊýµÄÖµ£¬±£ÁôÁ½Î»Ð¡Êý£®ÎÒÃÇÖªµÀº¯ÊýµÄ×÷ÓÃÓòµÄÎÊÌ⣬ÔÚº¯ÊýÄÚ²¿Ð޸ĵÄÖµÖ»»áÔÚº¯ÊýÄÚ²¿·´Ó¦³öÀ´£¬Ò²¾ÍÊÇÔÚ£û£ýÄÚ·´Ó¦£¬¶ÔÓÚº¯ÊýÍⲿµÄ±äÁ¿ËüÊÇ£¢¸ÐÊÜ£¢²»µ½ÕâÖֱ仯µÄ´æÔڵģ®ÄÇôÈÃÎÒ¿´ÏÂÊä³ö£º
Tax is:0.75
Cost is:36.73
ÕýÈçÎÒÃÇËùÔ¤ÏëµÄÄÇÑù£¬¶ÔÓÚ±äÁ¿taxÆäÖµ»¹ÊÇÔÀ´µÄÖµ£¬µ«±äÁ¿costÈ´³öºõÒâÁϵģ¢¸ÐÊÜ£¢µ½Á˱仯£®ÕâÊÇÒòΪÔÚº¯ÊýµÄ²ÎÊýÇ°ÃæÓУ¢&£¢·ûºÅ£¬ÕýÊÇÕâ¸ö·ûºÅµÄ´æÔÚʹµÃËüÄܹ»£¢¸ÐÊÜ£¢µ½ÄÚ²¿º¯Êý¶ÔËüµÄÐ޸ģ®ËùÒÔ°´ÖµºÍ°´ÒýÓõIJî±ðÒ²¾ÍÊÇÔÚÕâÀïÁË£®Èç¹ûÄãÏëÈú¯ÊýÄÚ²¿µÄÖµµÄÐÞ¸ÄͬʱҲÄܹ»·´Ó¦µ½º¯ÊýÍⲿ£¬ÄãÖ»ÒªÔÚ¶ÔÓ¦µÄ²ÎÊýÇ°Ãæ¼ÓÉÏ£¢£¦£¢¾ÍOKÁË£®
ÔÎÄÁ´½Ó:PHPº¯Êý°´ÒýÓô«µÝµÄÀý×Ó
Ïà¹ØÎĵµ£º
֮ǰһֱ¶¼ÊÇÔÚ·þÎñÆ÷µ÷ÊÔ³ÌÐò£¬ÓÐÒ»ÌìÏëŪµ½±¾µØÀ´£¬¿ÉËÀ»î¾ÍÊÇÁ¬²»ÉÏÔ¶³Ì·þÎñÆ÷ÁË¡£
±¾µØ£ºwindows+apache¡£
Ô¶³Ì·þÎñÆ÷£ºwindows+ms sql 2008.
phpºÍapache¸ÃÅäÖõĶ¼ÅäÁË£¬ÆäËû³ÌÐòÒ²¿ÉÒÔÔËÐУ¬¿É¾ÍÊÇÁ¬²»ÉÏÊý¾Ý¿â¡£
¿à¿àÑ°ÃÙ ......
¶ÔÓڽű¾°²È«Õâ¸ö»°ÌâºÃÏñÓÀԶûÍêûÁË£¬Èç¹ûÄã¾³£µ½¹úÍâµÄ¸÷ÖÖ¸÷ÑùµÄbugtraqÉÏ£¬Äã»á·¢ÏÖÓÐÒ»°ëÒÔÉ϶¼ºÍ½Å±¾Ïà¹Ø£¬ÖîÈçSQL
injection£¬XSS£¬Path Disclosure£¬Remote commands executionÕâÑùµÄ×ÖÑ۱ȱȽÔÊÇ£¬ÎÒÃÇ¿´ÁËÖ®ºóµÄÓÃ;ÄѵÀ½ö½öÊÇ×¥È⼦?¶ÔÓÚÎÒÃÇÏë×öweb°²È«µÄÈËÀ´Ëµ£¬×îºÃ¾ÍÊÇÄÃÀ´Ñ§Ï°
£¬¿ÉÊÇÍòÎï×¥¸ùÔ´£¬ÎÒà ......
1.ʹÓÃPHPµÄ´´Ê¼ÈË Rasmus Lerdorf дµÄAPCÀ©Õ¹Ä£¿éÀ´ÊµÏÖ£¨http://pecl.php.net/package/apc£©
APCʵÏÖ·½·¨£º
°²×°APC£¬²ÎÕÕ¹Ù·½Îĵµ°²×°£¬¿ÉÒÔʹÓÃPECLÄ£¿é°²×°·½·¨¿ìËÙ¼ò½Ý£¬ÕâÀﲻ˵Ã÷
ÅäÖÃphp.ini£¬ÉèÖòÎÊý apc.rfc1867=1 £¬Ê¹APCÖ§³ÖÉÏ´«½ø¶ÈÌõ¹¦ÄÜ£¬ÔÚAPCÔ´Âë˵Ã÷ÎĵµÀïÃæÓÐ˵Ã÷
´úÂë·¶Àý£º
¸´ÖÆPHPÄÚÈݵ½¼ô ......
PHPÅúÁ¿È¡µÃcheckboxµÄÖµ
1¡¢ÃüÃû
<input type='checkbox' name='checkbox[]' value=$dwmyrow[banzhu] />
2¡¢Ê¹ÓÃ
µ±¼Æ»®µ±×÷sqlÖ¸ÁîµÄÒ»²¿·Öʱ£ºÈç¹û²ÎÓë¿ØÖƵÄ×Ö¶ÎÊÇÊýÖµÐ͵ģ¬Ôò
if(! empty($_POST['checkbox'])) {
$expr = join(",", $_POST['checkbox']);
$sql = "select * from tbl_name where field in ......
ÏÈ°²×°µÄzlib ./configure --prefix=/usr/local/zlib È»ºó×°µÄcurl ./configure --prefix=/usr/local/curl --with-zlib=/usr/local/zlib °²×°gdĬÈÏ°²×° ./configure --prefix=/usr/local/gd --with-zlib=/usr/local/zlib (ÓÐЩǰÃæÏÈ°²×°jepg,png...with¾Í¿ÉÒÔÁË,Ö®ºóphpµÄʱºò¿´./configure --helpÀïÃæÓоßÌåµÄ) ° ......