PDA

View Full Version : Tarcking Bandwidth



Resshin
October 27th, 2002, 00:32
Are there any cgi or php scripts that track how many banwidth your site is using?

Force
October 27th, 2002, 12:48
try bandmin or mrtg

Who?
October 27th, 2002, 14:37
only the host is able to tell you how much bandwidth your site is using.

Salam
October 29th, 2002, 02:41
You can estimate your bindwidth by PHP :
Make a .php file for reading all your files, and save file sizes in a file.
For example , index.php :

<?
if(isset($HTTP_GET_VARS['file'])) $file = $HTTP_GET_VARS['file'] ;
else $file="main.htm" ;
if(!is_file($file)) die("404") ;
if(NotAllowed($file)) die("403") ;
readfile($file) ;
$fp=fopen("bw.txt","a") ;
fputs($fp, filesize($file)."\r\n") ;
fclose ($fp);
?>
main.htm is your first page and you must link to index.php for linking : <a href=index.php?file=myfile.html>
You should make a NotAllowed() function to only let your allowed files to be downloaded .

biggulp
October 29th, 2002, 06:02
highly ineffective, that means the linkson his site will need to change. a beter way would be to read from server logs?

YUPAPA
October 29th, 2002, 11:33
Yep, apache server log... or use webalizer.

Salam
October 30th, 2002, 01:05
You cant see log files in many hosting services .
Why he is looking for a script if he can access server files ?

YUPAPA
October 31st, 2002, 12:28
Using the log, you can calculate the bytes transferred and that's why he need a prog to summerized the transfer usage.

OriginXT
November 1st, 2002, 19:54
Originally posted by YUPAPA
Using the log, you can calculate the bytes transferred and that's why he need a prog to summerized the transfer usage.
hmm... I've been wondering how to install webalizer