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µÄcURL¿â¿ÉÒÔ¼òµ¥ºÍÓÐЧµØÈ¥×¥ÍøÒ³¡£ÄãÖ»ÐèÒªÔËÐÐÒ»¸ö½Å±¾£¬È»ºó·ÖÎöÒ»ÏÂÄãËùץȡµÄÍøÒ³£¬È»ºó¾Í¿ÉÒÔÒÔ³ÌÐòµÄ·½Ê½µÃµ½ÄãÏëÒªµÄÊý¾Ý
ÁË¡£ÎÞÂÛÊÇÄãÏë´Ó´ÓÒ»¸öÁ´½ÓÉÏÈ¡²¿·ÖÊý¾Ý£¬»òÊÇÈ¡Ò»¸öXMLÎļþ²¢°ÑÆäµ¼ÈëÊý¾Ý¿â£¬ÄÇžÍÊǼòµ¥µÄ»ñÈ¡ÍøÒ³ÄÚÈÝ£¬cURL ÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄPHP¿â¡£
PHPÖеÄCURLº¯Êý¿â£¨Client URL Librar ......
phpÊÇÒ»ÖÖ¿ª·ÅÔ´´úÂ롢ǶÈëʽ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ¡£
1¡¢PHPÒ²ÊÇǶÈëʽCGIÓïÑÔ¡£PHP4ÊDZ»·â×°ÔÚ±ê¼ÇÖеÄǶÈëʽÓïÑÔ£¬Äã¿ÉÒÔÇáÒ×µØÔÚPHPºÍHTMLÖ®¼ä½øÐÐת»»£¬¶ø²»±ØʹÓôóÁ¿´úÂëÒÔÊä³öHTML¡£Í¨ÓÃÍø¹Ø½Ó¿Ú(CGI)ÔÊÐíÓû§±àдÄܲúÉúHTMLÒÔ¼°¶¯Ì¬´¦ÀíÍøÒ³Êý¾ÝµÄ¼ÆËã»ú³ÌÐò¡£PHP¿ÉÒÔ±»¹éÀàΪCGI¡£
2¡¢Ó¦ÓÃPHPµÄÈý¸öÁìÓò£º(1)·þÎñÆ ......
PHPÄ£ÄâSMTP·¢ËÍÓʼþµÄÀà
<?php
/*********************************************************
filename£ºmail.class.php
describe£ºÓÊÏäµÄÅäÖ㬾²âÊÔ¿ÉÒÔÊÊÓÃÓÚLinuxºÍwindows
function£º¼ì²éÓÊÏäµÄºÏ·¨ÐÔ£¬·¢ËÍ»ù±¾µÄÓÊÏäÑéÖ¤ÐÅÏ¢
author£º etongchina@gmail. ......
ºÜ¾ÃÇ°ÔÚbaidu»Ø´ðÎÊÌâʱдµÄ“ÏòÒ»¸ö×Ö·û´®Ëæ»úÌí¼ÓÎÄ×Ö”µÄ½â¾ö·½°¸£¬¿ÉÒÔÖ§³ÖÖÐÓ¢ÎÄ
<?php
/*********************************************************
describe£º×Ö·û´®´¦Àí,¿ÉÒÔ´¦ÀíÖÐÓ¢ÎÄ
function£ºÏòÒ»¸ö×Ö·û´®Ëæ»úÌí¼ÓÎÄ×Ö
author£º etongchina
email2m ......