您好,欢迎访问一九零五行业门户网

保证include文件中的路径总是可用_PHP教程

这个是让人头疼的问题,我的解决办法是:使用绝对路径,并用 $main_path 和 $con_mainpath 两个变量保持其可移植性。
比如:
$con_mainpath=http://lastleaf.51.net/cgi-bin;
$mainpath=/home/myweb/cgi-bin
#include $mainpath/php/showphp.php; //调用别的文件。
//如果showphp.php中还要调用别的文件,
//则写成 url=$con_mainpath/php/title.gif 。
?>
注意区分url和文件路径,比如:
$fp=fopen($mainpath/files/a.htm,r);
echo click here;
http://www.bkjia.com/phpjc/532230.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/532230.htmltecharticle这个是让人头疼的问题,我的解决办法是:使用绝对路径,并用 $main_path 和 $con_mainpath 两个变量保持其可移植性。 比如: $con_mainpath=http...
其它类似信息

推荐信息