Hi this my first message, the first thing I really like the forum and my English was not so lousy I was more active. After the introduction I have a problem I'm trying to create a code writer the amount of storage space above it all, all one-byte second. Something like Google. I do not really know how to create such a thing that will always be are being synchronized with the server. Hope for help . thank avi.
I didn't fully understand your question. You want to display the amount of space you're using? Or perhaps pageload time?
No, I'm trying to create a counter going up every second, and showing the amount of MB added. Something like the Gmail.
I do not think you understood me, I want to open a hosting service,and giving my customers a few more megabytes every day. The script is just to show them hwo much add to Their account .
I would store the customers' join date in a database and then calculate their storage allowance according to this date.
I understand what you mean, GMail displays the amount of data that it's currently storing (every users) - Go to googlemail.com (not signed in) and look under "Lots of space Over 7413.652697 megabytes (and counting) of free storage." That number counts up every second. If you want it updating every second and displaying to the user without a page refresh, you'll want to use Javascript that performs an AJAX request to a PHP script that calculates the size of the users data. If you know what you're doing you can easily do this with JQuery and a small PHP function that echos out the size of the directory for a specific user. Although if you have a large site and have many users it's not recommended as it'll generate hundreds of extra requests to your server. No doubt Google have some sort of caching, i.e. check the size and cache it every 10 minutes and just use a javascript timer to countdown between those numbers (generating less traffic as it's not really real-time) but looks like it is. Regards, Steve