Author Topic: Applets - Most practical way of storing user info  (Read 4917 times)

0 Members and 1 Guest are viewing this topic.

Offline m0l0ko

  • Peasant
  • *
  • Posts: 129
  • Cookies: -4
    • View Profile
Applets - Most practical way of storing user info
« on: December 22, 2012, 07:23:00 am »
With PHP, I used to store all visitor stats (i.e. their IP, OS, browser details etc.) in a MySQL database but setting of a DB isn't that practical so I wanted a more quick and easy method so I switched to writing to txt files. Thats too crude so recently I started writing to XML files. Works very well. An excellent balance between efficiency and practicality.

I want to get my java applets to log visitor stats too but I'm wondering what the best way to do that is. Right now I'm getting the applet to write cookies then getting PHP to retrieve them but thats silly. Would the best way to do this be to just write to XML files or are there better ways to do it with java?

Offline Uriah

  • Sir
  • ***
  • Posts: 454
  • Cookies: 42
  • άξονας
    • View Profile
Re: Applets - Most practical way of storing user info
« Reply #1 on: December 22, 2012, 08:06:59 pm »
Sorry, but im not all that familiar with php and java yet. But posting this just to say that I think you are doing very well with learning and improving and your questions seem to have more of a pupose than those of others.
Keep it up :)

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: Applets - Most practical way of storing user info
« Reply #2 on: December 26, 2012, 02:23:10 pm »
I can't tell you the most practical way, since I have not much experience with applets.
But for reading and writing XML-files I recommend using xstream, which is pretty easy in usage: http://xstream.codehaus.org/

If you need more control, you will have to use a SAX or DOM parser: http://www.mkyong.com/tutorials/java-xml-tutorials/

Offline m0l0ko

  • Peasant
  • *
  • Posts: 129
  • Cookies: -4
    • View Profile
Re: Applets - Most practical way of storing user info
« Reply #3 on: January 04, 2013, 02:02:05 am »
I ended up just using the netscape.javascript.JSObject package to write store the data in cookies then I used PHP to write to the XML file.