View Full Version : Recording user information in a seperate file.

05-15-2009, 02:42 PM
I have some code that currently (probably not that acuratly) detects someones bandwidth before playing a video, currently I have it so it writes out that information to the user, how can I write this information to a separate .txt document or something similar?

// this method is called when the bandwidth check is done
onBwDone: function(url, chosenBitrate, bitrate) {
var el = document.getElementById("info");
el.innerHTML = "Your speed is: " +bitrate+ "<br />Video file served: " +url;

05-15-2009, 03:18 PM
If your purpose is to record user information for your own data records then the easiest/most secure method would be to use a server-side language in conjunction with a database (ASP/PHP/JSP and MySQL for example). You can also write to text files as well though that's a bit sloppier.

If your purpose is to remember the user throughout their experience on your website (so you don't have to keep checking) then cookies are your best bet. These can be set with Javascript only, which means you don't have to meddle with server-side code.

Let me know what you want and I can help you with the specific code.