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

phpѧϰÐĵÃ(ÊʺÏphp³õѧÕß)


À´Ô´£º ·¢²¼Ê±¼ä£º2009-09-18 ·¢²¼ÈË£º ä¯ÀÀ£º30È˴Π ×ÖÌ壺[´ó ÖРС]  
 ¡¾1¡¿Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿ get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½
µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
¡¾2¡¿Win32ÏÂapache2 ÓÃget·½·¨´«µÝÖÐÎIJÎÊý»á³ö´í
test.php?a=ÄãºÃ&b=ÄãÒ²ºÃ
´«µÝ²ÎÊýÊǻᵼÖÂÒ»¸öÄÚ²¿´íÎó
½â¾ö°ì·¨:"test.php?a=".urlencode(ÄãºÃ)."&b=".urlencode(ÄãÒ²ºÃ)
.............
 
¡¾3¡¿win32ϵÄsession²»ÄÜÕý³£¹¤×÷
php.iniĬÈϵÄsession.save_path = /tmp
ÕâÏÔÈ»ÊÇlinuxϵÄÅäÖã¬win32ÏÂphpÎÞ·¨¶ÁдsessionÎļþµ¼ÖÂsessionÎÞ·¨Ê¹ÓÃ
°ÑËü¸Ä³ÉÒ»¸ö¾ø¶Ô·¾¶¾Í¿ÉÒÔÁË£¬ÀýÈçsession.save_path = c:windows emp
¡¾4¡¿ÏÔʾ´íÎóÐÅÏ¢
µ±php.iniµÄdisplay_errors = On²¢ÇÒerror_reporting = E_ALLʱ£¬½«ÏÔʾËùÓеĴíÎóºÍÌáʾ£¬µ÷ÊÔµÄʱºò×îºÃ´ò¿ªÒÔ±ã¾À´í£¬Èç¹ûÄãÓÃÒÔÇ°phpд·¨´íÎóÐÅÏ¢¶à°ëÊǹØÓÚ䶨Òå±äÁ¿µÄ¡£±äÁ¿ÔÚ¸³ÖµÒÔÇ°µ÷ÓûáÓÐÌáʾ£¬½â¾ö°ì·¨ÊÇ̽²â»òÕßÆÁ±Î
ÀýÈçÏÔʾ$foo£¬¿ÉÒÔif(isset($foo)) echo $foo »òÕßecho @$foo
¡¾5¡¿Win32ÏÂmail()²»ÄÜ·¢Ë͵ç×ÓÓʼþ
ÔÚlinuxÏÂÅäÖúõÄsendmail¿ÉÒÔ·¢ËÍ£¬ÔÚwin32ÏÂÐèÒªµ÷ÓÃsmtp·þÎñÆ÷À´·¢Ë͵ç×ÓÓʼþ
ÐÞ¸Äphp.iniµÄSMTP = ip //ipÊDz»´øÑéÖ¤¹¦ÄܵÄsmtp·þÎñÆ÷(ÍøÉϺÜÄÑÕÒµ½)
php·¢ËÍÓʼþµÄ×îºÃ½â¾ö·½·¨ÊÇÓÃsocketÖ±½Ó·¢Ë͵½¶Ô·½email·þÎñÆ÷¶ø²»ÓÃת·¢·þÎñÆ÷
¡¾6¡¿³õ×°µÄmysqlÈç¹ûûÓÐÉèÖÃÃÜÂ룬Ӧ¸ÃʹÓÃ
update mysql.user set password="yourpassword" where user="root"
ÐÞ¸ÄÃÜÂë
¡¾7¡¿header already sent
Õâ¸ö´íÎóͨ³£»áÔÚÄãʹÓÃHEADERµÄʱºò³öÏÖ£¬Ëû¿ÉÄÜÊǼ¸ÖÖÔ­Òò£º1£¬ÄãÔÚʹÓÃHEADERÇ°PRING»òÕßECHOÁË2.Ä㵱ǰÎļþÇ°ÃæÓпÕÐÐ3.Äã¿ÉÄÜINCLUDEÁËÒ»¸öÎļþ,¸ÃÎļþβ²¿ÓпÕÐлòÕßÊä³öÒ²»á³öÏÖÕâÖÖ´íÎó¡££¡
¡¾8¡¿¸ü¸Äphp.iniºóûÓб仯
ÖØÐÂÆô¶¯web server£¬±ÈÈçIIS£¬ApacheµÈµÈ£¬È»ºó²Å»áÓ¦ÓÃ×îеÄÉèÖÃ
¡¾9¡¿phpÔÚ2003ÉÏÃæ°²×°£¨ISAPIµÄ°²×°·½·¨¿ÒÇë¸ßÊÖÖ¸½Ì£©
PHP4µÄphp4isapi.dllºÃÏñºÍ2003ÓÐЩ³åÍ»£¬Ö»ÄÜÓÃCGIģʽ°²×°
²½ÖèÒ»£¬ÏÈwww.php.net ÏÂÔÚÒ»¸ö°²×°³ÌÐò£¬ÎÒÊÇ×°µÄÊÇ£ºphp-4.2.3-installer.exe£¬ÄãÒ²¿ÉÒÔÈ¥ÕÒ×îеİ汾£¬ÔÚ°²×°ph


Ïà¹ØÎĵµ£º

PHPÍøÕ¾¿ª·¢·½°¸£¨¿ª·¢ÐÂÈ˱ضÁ£©

Ò»¡¢¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ã濪·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a)·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊÔ»ú)¡£
ii.Êý¾Ý¿â·þÎñÆ÷£º WIN2003 server+SQL server  ......

ΪPHP°²×°Xdebugµ÷ÊÔ¹¤¾ß

Ò»¡¢zend studioµÄÅäÖÃ
1.µ½zendµÄ°²×°Ä¿Â¼ÏÂɾ³ýÁ½¸öÎļþ(¿ÉÓпÉÎÞ.ÖÁÉÙÎÒ²»É¾³ýÒ²²»Òƶ¯¿ÉÒÔ)
   ÎҵݲװĿ¼£ºD:\Program Files\Zend\Zend Studio - 7.0.2\plugins\
   ɾ³ýµÄÎļþÊÇ£ºcom.zend.php.debug.core_7.0.0.v20090607-1658.jar
        &nbs ......

PHP²éѯÏÔʾSqlServerÖеÄÖÐÎÄ

ÒòΪ¹¤×÷ÐèÒª£¬Êý¾Ý¿âʹÓõÄMS SQL Server2005£¬¶øĬÈϵÄÅÅÐò¹æÔòÊÇSQL_Latin1_General_CP1_CI_AS¡£´´½¨ÁËÒ»¸ö±í£¬ÒòΪÐèÒª´æ´¢ÖÐÎÄÐÅÏ¢£¬Address×ֶεÄÀàÐÍÊÇnvarchar(255)¡£
´ËʱʹÓÃphpÀ´Á¬½Ósql server£¬Ò³ÃæµÄ±àÂëºÍÎļþµÄ±àÂ붼ÊÇUTF-8£¬²éѯ´ËAddress×ֶΣ¬ÏÔʾÔÚÒ³ÃæÉÏÊÇ???Ö®ÀàµÄ¡£Ôõô½â¾ö£¿
ʹÓÃ
iconv('iso- ......

PHP£¬JavaºÍ.NETµÄ¹ýÈ¥£¬ÏÖÔÚºÍδÀ´)

PHP£¬JavaºÍ.NETµÄ¹ýÈ¥£¬ÏÖÔÚºÍδÀ´
±¾ÎĶÔWeb±à³ÌÓïÑÔ½øÐÐÁËÒ»·­ÌÖÂÛ£¬ÌÖÂ۵ĶÔÏóÖ÷ÒªÊÇPHP£¬JavaºÍ.NETƽ̨ÉϵÄVB.NETºÍC#¡£ÎÄÕ¶ÔËÄÖÖÓïÑÔÔÚWeb¿ª·¢ÉϵÄÌصã½øÐÐÁ˼òÂÔµÄÃèÊö£¬²¢Ö÷ÒªÔÚÐÔÄÜ·½Ãæ½øÐÐÁ˱Ƚϡ£
¡¾51CTO¾«Ñ¡ÒëÎÄ¡¿PHP£¬JavaºÍ.NETÒѾ­³ÉΪÁËδÀ´ÎåÄêÄÚ³ÌÐòÔ±±ØÐë¾ß±¸µÄ¼¼ÄÜ£¬¶øÕâÈýÖÖÓïÑÔ£¨»òÕß¿ÉÒÔ³Æ֮Π......

phpÖÐ__FILE__³£Á¿Ó÷¨¼ò½é

1.phpÖеÄ__FILE__³£Á¿·µ»ØÎļþµÄÍêÕû·¾¶ºÍÎļþÃû.
2.dirname(__FILE___) º¯Êý·µ»ØµÄÊǽű¾ËùÔÚÔڵķ¾¶¡£
±ÈÈçÎļþ b.php °üº¬ÈçÏÂÄÚÈÝ£º
<?php
$basedir = dirname(__FILE__);
?>
Èç¹ûb.php±»ÆäËûĿ¼ÀïµÄa.phpÎļþrequire »òÕß include È¥ÒýÓõĻ°¡£
±äÁ¿?$basedir µÄÄÚÈÝ»¹ÊÇb.phpËùÔÚµÄÄǸöÎļþ¼Ð ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ