|
any1 with experteese in these fields
/\|-||\/|/\|)
|
|
|
|
|
Hi there.
I want to get a directory size by PHP.
for example I used this code :
$size = disk_total_space("../upload")/ 1024;
echo $size;
but I saw this warning :
Warning: disk_total_space()
[function.disk-total-space]: The system cannot find the
path specified. in H:\Apache2.2\htdocs\c-panel\cp_folders.php
on line 88
I'm sure that this folder "../upload" exist.
What's wrong with it and how I can solve it ?
thanks in advance
|
|
|
|
|
All right, I found this function here[^]
function dirsize($dir,$buf=2)
{
static $buffer;
if(isset($buffer[$dir]))
return $buffer[$dir];
if(is_file($dir))
return filesize($dir);
if($dh=opendir($dir))
{
$size=0;
while(($file=readdir($dh))!==false)
{
if($file=='.' || $file=='..')
continue;
$size+=dirsize($dir.'/'.$file,$buf-1);
}
closedir($dh);
if($buf>0)
$buffer[$dir]=$size;
return $size;
}
return false;
}
|
|
|
|
|
hi,
May be it is not detecting this type of relativ path.You can try absolute path here
$size = disk_total_space("/upload")/ 1024;
echo $size;
I hope this will work.
Thanks
-Inder Singh
|
|
|
|
|
|
Hi Guys,
I have a PHP script that grabs customer names (about 30,000+) from a MySQL Database, and using PHP outputs to the client browser. From this list then can select which customer they will insert, or update, a record for.
Once the page is loaded, I use an onChange event (using AJAX) attached to the select list to populate part of the page with with customer information.
There are basically two pages that use this. On the INSERT page, where new SALE record is created, and the UPDATE page, where a sale may be edited. Obviously the end user needs to be able to select ANY of the customers stored, and the assumption that they may know the spelling, or part thereof, of a customer cannot be made... otherwise a nice search and select function would be great!
It is obviously bad practice to load so many customers in at once, So I am looking for suggestions or solutions.
One idea i had was to load only the customer for which the sale is to be edited, and then when they click on it, load the rest, but that still sucks.
maybe a search function is the best way, just wish users were not so incompetent :P
cheers for any ideas guys,
mick
|
|
|
|
|
Breaking the data down into sub-categories, such as all customers with surnames beginning with A, for example, followed by all of these customers with first names beginning with A, or that live in a particular region; I assume this would cut the number of records being fetched down drastically?
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Usually when I have that many records I opt for a paginated list and not rely on comboboxes or
One option I can think of is using AJAX to dynamically update the combobox as selectedIndex reaches the last element -- insert 500 more. However this still has the problem that if the user scrolls without using keyboard selectedIndex doesn't change so you would need to capture the scroll position as well and I'm not sure that is possible inside a drop down or native HTML control. Lastly using AJAX like this would destroy any chance of accessibility you might have. If someone disabled JavaScript they'd never be able to use your application.
I would go for either two or more combobox'es and categorize them or use a paginated list.
I'm finding the only constant in software development is change it self.
|
|
|
|
|
Hi guys,
Thanks for your interesting replies.
Hockey, I had a similar idea with the automatic update, its a great idea, and accessability doesnt matter, since this is an internal intranet style project, and they won't need to implement accessability standards (until the next programmer is hired, lol! poor bastard)
In regards to the Javascript being disabled, the way the program works now, almost every page relies on Javascript being enabled. Every avenue with this project has been against any standards, and most coders would have a hemorage if they saw the source code! :/
The users will ALWAYS use the mouse to select from the drop down menu, and it already has an ajax onChange event attached, so I will have to read up about this selectedIndex and how to implement it.
I believe this is probably the correct way to go though.
Once again, thanks very much for your help guys,
Mick
|
|
|
|
|
Thought some of you might be interested in this: DevExtraPHP
It's a very simple PHP syntax highlighter for Visual Studio 2005/2008. It doesn't support anything advanced like statement completion or debugging, but for the casual PHP developer like myself it makes PHP just that bit more pleasant.
Brad
|
|
|
|
|
bradr wrote: It's a very simple PHP syntax highlighter for Visual Studio 2005/2008. It doesn't support anything advanced like statement completion or debugging, but for the casual PHP developer like myself it makes PHP just that bit more pleasant.
I'm using DreamWeaver. It's great.
However thanks.
|
|
|
|
|
Hi there.
What's difference between $_REQUEST and $_POST ?
And which of them is better to using ?
Thank you.
|
|
|
|
|
OK. Thank you for reply
We talked about it here[^] and I got my answer.
|
|
|
|
|
You can submit forms using one of two methods- GET or POST. These go into $_POST and $_GET arrays when received by a PHP script. You cannot access values in the $_GET array by using $_POST['value'] and vice versa. The $_REQUEST array however, contains both GET and POST values regardless. So if you post or get value 'x' in a form, it is accessible by $_REQUEST['x']. You can find more information here-
http://www.w3schools.com/PHP/php_post.asp[^]
Good luck!
Ranjit Viswakumar
Professional Services Specialist
rviswakumar@hostmysite.com
http://hostmysite.com/?utm_source=bb[^]
|
|
|
|
|
It was an old question.
Thanks anyway TapeBoy929.
|
|
|
|
|
i have a table counter with a attribute count (integer) with value = 1
i get the value of it
$sql = 'SELECT count FROM counter';
$result = mysql_query($sql, $link);
$row = mysql_fetch_assoc($result);
$tempcounter = $rows['count'];
$tempcounter = $tempcounter + 1;
now doing this i have the current value of count in a variable $tempcounter
i now need to update table to increment the counter;
$sql2 = "UPDATE counter SET count = $tempcounter";
i m having diffculties with the sql string
HELP
reply me at junaidzhotmail@hotmail.com
|
|
|
|
|
For starters, you can save yourself a lot of effort by just performing the update in MySQL:
UPDATE count SET counter = counter + 1
I'm finding the only constant in software development is change it self.
|
|
|
|
|
Here[^] is very useful website for learning MySql syntax .
Try it
|
|
|
|
|
Hi there.
Do you know when we must use LONGTEXT type in MYSQL?
Thanks in advance.
Freshman
|
|
|
|
|
|
|
hi,
When we need heavy data to store in a single field then we prefer this datatype.For example you may want to save a long page data in database and that can be greater then 16KB.As for TEXT datatype size is limited to 16KB.
Thanks.
-Inder Singh
|
|
|
|
|
Hello!
I am a webdeveloper at a Begining stage I am facing a problem on api application.please help me as soon as possible. The problem is....
Extracting Users photo from facebook and Myspace from a particular user's email address and password provided such as
Using user email and password we can fetch users profile photos.
Thanks
|
|
|
|
|
you can implement by searching in the phpclasses.org. I am also in same problem. Probably other expert will give us the solusion.
Soumen Nandy.
|
|
|
|
|
Facebook has an extensive developers API. If they don't have an API for image retreival it's likely what you want to do would be considered illegal.
Facebook Developers API[^]
You'd better read the fine print and make sure you can do this.
I'm finding the only constant in software development is change it self.
|
|
|
|