View Full Version : Space limited
weronpc
05-17-2003, 07:56 PM
Hello,
I want to create a folder for each user and each user allow to limited amout of space.
I want to use php check the folder size, if folder size is greater than 100 megabytes, then permission equal to false. Do anyone know how to do it or is it even posible to do so?
Thank you
Nightfire
05-17-2003, 08:04 PM
maybe this modified? http://www.developerfusion.com/show/1755/
weronpc
05-18-2003, 12:43 AM
Thanx for the site, it's great.
question:
This line
if (eregi("^\.{1,2}$",$file))
continue;
from my understanding, it's trying to say if $file contains this characters "^\.{1,2}$" then quit the loop.
am I right? if yes, why this display "no"
<?php
$email = "hello@.com";
if (eregi("^\.{1,2}$@",$email))
{
echo "contains @ sign";
}
else
{
echo "no";
}
?>
missing-score
05-18-2003, 10:39 AM
Im pretty sure it is checking that the dir is not 1 or 2 dots.
./ the folder you are in.
../ Back one, (root)
Weirdan
05-19-2003, 10:46 AM
2weronpc
eregi stands for "compare string with pattern, case insensitive". "pattern" is the POSIX regular expression. You could learn more about it from http://www.php.net/manual/en/function.eregi.php
am I right? if yes, why this display "no"
$email = "hello@.com";
if (eregi("^\\.{1,2}$@",$email))
You're trying to search for "one or two dots in the beginning of the string followed by end-of-string followed by at sign". Is it your intention? :)
Definitely you have to read http://www.php.net/manual/en/ref.regex.php and (possibly) http://www.php.net/manual/en/ref.pcre.php
whackaxe
05-19-2003, 02:35 PM
very good tutorial on regular expressions here: http://www.phpbuilder.com/columns/dario19990616.php3 its better than sifting through the php docs :p
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.