DiskSpace


About the script
Changes
Requirements
Installing the script
FAQ
Support
Copyright, etc.

About the script

This script shows the number of megabytes used on your web site account and the number of megabytes left. This is quite a useful thing to know, but most FTP clients are not able to show it -- and that's where this script comes in. DiskSpace outputs a graph showing the percentage of the disk space used, the actual number of megabytes used, etc. The page containing this information is of course password protected.



Changes

0,21 -> 0,22
Italian translation -- thanks to
Silvia Agatello.

0,2 -> 0,21
Russian translation. Thanks to Yurik_A.

0.1.1 -> 0,2





Requirements





Installing the script

  1. Load the script (diskspace.php) into a plain text editor such as KEdit (Linux) or Notepad (Windows). Edit the variables at the top of the page. $languageFile is the path to the language file of your choice. If in doubt, don't change this. $user_home should be set to the home directory of your user on the server. This could be something like "/home/myuser". If you don't know the home directory, do the following: Go online, open a command line window, and write telnet yourdomain.com (replace yourdomain.com with the domain name of your server). When you've entered your user name and password, a command promt will appear. Now just type pwd. This will output your home directory. The next variable is $available_space. Write the number of megabytes available on your web site account, i.e. "10" or "50". The last variable is $password. Just choose a password.
  2. Upload this directory (the diskspace directory) to your server.
  3. That's it! All you need to do now is to open your browser and go to http://yourdomain.com/somedir/diskspace/diskspace.php. If it doesn't work, check the FAQ.




FAQ

When I run the script, the browser shows a white page with a lot of PHP code.
You need to add the following lines to the .htaccess file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php3 .php

See the .htaccess question in this FAQ if you don't know how to do this.

How do I edit the .htaccess file?
Well, first of all you need to establish whether there's a .htaccess file in your document root or not. This can be done be performing the following test: Point your browser to http://yoursite.com/.htaccess (note the dot before "htaccess"). If you get a 404 error (File Not Found), there's no .htaccess file in your document root. However, if you get a 403 error ("Forbidden"), there's a .htaccess in your document root. If you don't have a .htaccess file, you will need to make one. Open a text editor, click "New" and write the necessary lines (the lines are shown elsewhere in this FAQ). You should not write anything else besides these lines -- no HTML tags, no PHP tags, etc. When you're done writing the file, upload it to the server and place it in the document root. Perform the test above to make sure the file has been placed in the right location. If there's already a .htaccess file in your document root, all you need to do is load this file into a text editor and add the appropiate lines at the bottom of the file (the lines you need to write are shown elsewhere in this FAQ).

DiskSpace says that I have used 0 disk space on my web site account even though I know that I have used a lot more.
This can be caused by two things:

  1. The $user_home variable has not been set correctly.
  2. Your server runs PHP in safe mode and du is not installed in safe_mode_exec_dir. Check the requirements section.




Copyright, etc.

This script is released under the terms of
the GNU General Public License (also known as "GPL").