叁柒設計 三七设计 Three seven design
详细信息
来自:关键字:

关于fckeditor 上传路径设置问题(PHP)

  December 22nd,2008 15:44:59   Category : PHP+Mysql
 Click (1639)

关于fckeditor 文件上传路径设置问题,config.php设置文件中。这个路径设置,在本机测试时需填写网站文件的绝对位置,
但是我的网站在其它服务器托管时,我这个路径该怎么设定,求救。请高手赐教!

// Path to user files relative to the document root.
$Config['UserFilesPath'] = 'D:\\www\\upimg\\' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Useful if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = 'D:\\www\\upimg\\' ;

经历几个钟头。上网查资料。
唉。然后用笨办法以。还是用绝对地址办法
$Config['UserFilesPath'] = 'http://www.abc.com/upimg/' ;这个是网页显示图片的地址!
$Config['UserFilesAbsolutePath'] = 'D:\\www\\upimg\\' ; 这个是上传的绝对地址
这个绝对地址可以通过一个方法获取,如果你是托管在别人的服务器上
请使用
<?php
$a1=strlen(basename(getenv('SCRIPT_NAME')));
$a2=getenv('SCRIPT_FILENAME');
$a3=substr($a2,0,strlen($a2)-$a1);
print $a3;
?>
得到你网站在服务器上的绝对地址。,一切搞定!

[ 资讯评论 ]
暂时没有任何评论!
[ 提交评论 ]
请选择表情
  • 昵称:
  • *
  • 验证码:
  • *点击更换验证码
  • 尚能输入个字符
申明:本网站部分分享内容来自网络,如有侵权请及时与我联系,谢谢,另网友评论仅代表个人观点,与本站立场无关,如果在评论中发表违反我国任何法律的,请即时与我们联系(QQ:77132915),我们将立即予以删除. [ 注:提交评论后,通过审核后方能在网站上显示!]