phpÖлñÈ¡¸÷ÖÖ·¾¶
test.php -------------------------------------------------------------------------------------
echo $_SERVER['DOCUMENT_ROOT'].""; //»ñµÃ·þÎñÆ÷Îĵµ¸ù
echo $_SERVER['PHP_SELF'].""; //»ñµÃÖ´ÐиôúÂëµÄÎļþ·þÎñÆ÷¾ø¶Ô·¾¶
/*
phpÊÖ²áÉϵĽâÊÍ£º “PHP_SELF” µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû£¬Óë document root Ïà¹Ø¡£¾ÙÀýÀ´Ëµ£¬ÔÚ URL µØַΪ http://example.com/test.php/foo.bar µÄ½Å±¾ÖÐʹÓà $_SERVER['PHP_SELF'] ½«»áµÃµ½ /test.php/foo.bar Õâ¸ö½á¹û¡£__FILE__ ³£Á¿°üº¬µ±Ç°£¨ÀýÈç°üº¬£©ÎļþµÄ¾ø¶Ô·¾¶ºÍÎļþÃû¡£ Èç¹û PHP ÒÔÃüÁîÐз½Ê½ÔËÐУ¬¸Ã±äÁ¿ÔÚ PHP 4.3.0 ֮ǰÎÞЧ¡£ “DOCUMENT_ROOT” µ±Ç°ÔËÐнű¾ËùÔÚµÄÎĵµ¸ùĿ¼¡£ÔÚ·þÎñÆ÷ÅäÖÃÎļþÖж¨Òå¡£
*/
echo __FILE__.""; //»ñµÃÎļþµÄÎļþϵͳ¾ø¶Ô·¾¶
echo dirname(__FILE__); //»ñµÃÎļþËùÔÚµÄÎļþ¼Ð·¾¶
-------------------------------------------------------------------------------------
ÔÚD:/AppServ/www/ivyschool.com/test.php ,½á¹ûÈçÏ£º D:/AppServ/www /ivyschool.com/smarty_config.php D:\AppServ\www\ivyschool.com\smarty_config.php D:\AppServ\www\ivyschool.com
Ïà¹ØÎĵµ£º
phpÊÇÒ»ÖÖ¿ª·ÅÔ´´úÂ롢ǶÈëʽ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ¡£
1¡¢PHPÒ²ÊÇǶÈëʽCGIÓïÑÔ¡£PHP4ÊDZ»·â×°ÔÚ±ê¼ÇÖеÄǶÈëʽÓïÑÔ£¬Äã¿ÉÒÔÇáÒ×µØÔÚPHPºÍHTMLÖ®¼ä½øÐÐת»»£¬¶ø²»±ØʹÓôóÁ¿´úÂëÒÔÊä³öHTML¡£Í¨ÓÃÍø¹Ø½Ó¿Ú(CGI)ÔÊÐíÓû§±àдÄܲúÉúHTMLÒÔ¼°¶¯Ì¬´¦ÀíÍøÒ³Êý¾ÝµÄ¼ÆËã»ú³ÌÐò¡£PHP¿ÉÒÔ±»¹éÀàΪCGI¡£
2¡¢Ó¦ÓÃPHPµÄÈý¸öÁìÓò£º(1)·þÎñÆ ......
ºÜ¾ÃǰЩµÄһЩÎÄÕ£¬ÄÇʱºò¼¼Êõ»¹ÔÚ³õ¼¶½×¶Î£¬ÔÚÏÖÔÚ¿´À´´úÂë¹»Àõģ¬µ«ÊÇÈË×ÜÊÇÒ»²½²½×ßÉÏÀ´µÄ£¬Ï£ÍûÄܸø³õѧÕßÒ»µã¹ÄÀøÁË£¡
<?php
/*********************************************************
filename£ºmulti.php
describe£º ÏÔʾ¶àÓÚÒ»Ò³µÄÁ´½Ó
function£º·ÖÒ³ÏÔʾģ¿é
auth ......
PHPÄ£ÄâSMTP·¢ËÍÓʼþµÄÀà
<?php
/*********************************************************
filename£ºmail.class.php
describe£ºÓÊÏäµÄÅäÖ㬾²âÊÔ¿ÉÒÔÊÊÓÃÓÚLinuxºÍwindows
function£º¼ì²éÓÊÏäµÄºÏ·¨ÐÔ£¬·¢ËÍ»ù±¾µÄÓÊÏäÑéÖ¤ÐÅÏ¢
author£º etongchina@gmail. ......
Ò»¡¢ ¿ª·¢³ÉÔ±
a)ÏîÄ¿Ö÷¹Ü
b)Ò³ÃæÃÀ¹¤
c)Ò³Ã濪·¢
d)·þÎñ¶Ë³ÌÐò¿ª·¢
e)ϵͳÓëÊý¾Ý¹ÜÀí
f)²âÊÔÓë°æ±¾¿ØÖÆ
¶þ¡¢ ÍøÕ¾×鿪·¢¼òÃ÷Á÷³Ì
Èý¡¢ ¿ª·¢¹¤¾ßÓë»·¾³
a) ·þÎñÆ÷ÅäÖÃ
i. WEB·þÎñÆ÷£º FreeBSD6.1+Apache2.0+PHP5.0£¬SVN°æ±¾¿ØÖÆ·þÎñ(½ö²âÊÔ»ú)¡£
ii. Êý¾Ý¿â·þÎñÆ÷£º WIN2003 server+SQL server 2000 ......
PHP»ñȡʱ¼ä´íÎóµÄÐÞÕý·½·¨
½ñÌìÔËÐÐPHP³ÌÐòµÄʱºò£¬ºÜÆæ¹Ö£¬ÎªÊ²Ã´PHP»ñÈ¡µÄʱ¼ä±Èʵ¼Êʱ¼äÕûÕûÉÙÁË8Сʱ£¬ÒÔǰҲûעÒâÕâ¸öÎÊÌ⣬×ÜÒÔΪÊÇʱ¼äÏÔʾ´íÁË£¬ÊÇ°²×°Èí¼þµÄÎÊÌ⣬½ñÌìÔÚÍøÉϲéÁËÏÂ×ÊÁÏ£¬ÔÀ´ÁíÓÐÔÒò¡£
ÆäʵÕâºÍʱÇøÓйأ¬PHPĬÈÏ»ñÈ¡0ʱÇø¿ªÊ¼µÄʱ¼ä£¬ÖйúÔÚ¶«°ËÇø£¬Òò´Ë£¬ÎÒÃÇÖÐ ......