0

I've a social network that I'm building a mobile site for. It's pretty much finished although I'm struggling to mkdir when a user creates an account on the mobile site in the overall host root. Is it possible?

I tried this:

mkdir("http://www.domain.com/image/".$mid, 0777);
mkdir("http://www.domain.com/image/".$mid."/temp", 0777);
mkdir("http://www.domain.com/image/".$mid."/preview", 0777);
umask($oldumask); 

copy('http://www.domain.com/images/default.png', 'http://www.domain.com/image/'.$mid.'/default.png');
copy('http://www.domain.com/images/default.png', 'http://www.domain.com/image/'.$mid.'/thumb-default.png');

But unsurprisingly it didn't work. How can I go back to the host root of the site, not the domain root? Is it possible? Any suggestions?

See the DIR layout example here:

Dir

4

1 回答 1

0

在您的 index.php(或任何其他涵盖其基础的文件)中的Echo __DIR__dirname(__FILE__)对于低于 5.3 的 PHP)。它应该返回从服务器根目录到 index.php 的完整路径。mkdir需要服务器根目录,而不是浏览器根目录。

于 2013-05-03T22:32:16.103 回答