Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bandwidth

Status
Not open for further replies.

airj1012

Technical User
May 6, 2002
2
US
Hello, I'm no expert with PHP so I need a little help. Currently I have a web host that only allows a certain amount of bandwidth. I remember somebody saying that you can use PHP scripting and upload it to your ftp account and it will be able to tell you how much bandwidth you have left. Is this true? And if so would anybody mind sharing code with me? Thank You.

Michael Konen
 
I think you misunderstood.
Simple PHP code can tell you how much disk space you have left on your webserver (if your webserver supports PHP) so you know when to not upload anythiing else.

Bandwidth is how much traffic in bytes your site will serve.
If you have a 100k jpg file which is downloaded 1000 times = 100mb of traffic.(is my math right , it been a long day - hope you get the idea tho:))
Some sites limit the amount of traffic your site can have each month (especially free hosts). ***************************************
Party on, dudes!
[cannon]
 
Ya, I know I am allowed 5 gigs of transfer I month, I just want a way so that I can monitor it and see how close I get to using it up every month. Thanks
 
I may not be able to help with much PHP code but I can offer an idea... A screwball way of using PHP to do this is to log and limit the number of downloads for your larger files.

Suppose you have a large MOV file that is most likely to eat up your bandwidth. You can log to a basic text file how many times that the page to it is accessed (very much like a basic web counter). When a certain number is met (suppose 200 downloads), the link for the MOV file is no longer displayed.

Ex:
if ($downloads<=&quot;200&quot;) {
print (&quot;<a href=\&quot;my_movie.mov\&quot;>click here</a>\n&quot;);
}
 
Ah right, sorry I misunderstood you.

If I have any mind numbingly splendid ideas I'll post them, its something that would be useful :)
***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top