You are here: Re: multi-user php setup problem « PHP Programming Language « IT news, forums, messages
Re: multi-user php setup problem

Posted by Dikkie Dik on 02/08/07 12:13

> Hi
> I have built a free-php-space website, after the user is
> registered, he will have 100MB php space. the server is linux+apache.
> The location of the user's file is in:
>
> /phpspace/<username>
>
> My problem is : if user A has uploaded a php file, user A can use php
> to read user B directory. How can i isolate them?

You can't. In fact, it is not user A who put the file there. Uploading
works as follows: The file sent by the browser is put in the server's
temp directory. From there, you use the move_uploaded_file() function to
put it in, say /phpspace/usera/. It is the webserver-system-user (such
as "apache") who put the file in that directory.

> That mean if there is php file in /phpspace/usera/index.php, how can i
> make it can read the directory phpspace/usera only?

If /phpspace/usera/ is publicly visible (from the browser, I mean), then
everyone can access the file. Therefore, it is better to put these user
directories outside the webroot. In that case, only the server can reach
them, and you can do any user management in PHP.

Best regards

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация