Skip to main content
gamedev.net
🔒 Locked

I am learning server side programming...

Started by Jakarta 5 replies 350+ views
Original Post
Jakarta
Jakarta
Ok I am learning server side programming using java (servlets). And I would like a nice small project which would be cool and preferably also use a db (MYsql). I am thinking something along the lines of a simple forum. which brings me to my next question. How does a forum keep track of who is signed on and who isn''t does it sign on a certain IP address for a certain amount of time?
Programmer One
Programmer One
You sign on.

If you don''t reconnect to the server for a certain amount of time, it should log you off, unless you manually logged off via a log off button.

Ratman
Ratman
The issue of logins/passwords should be pretty straightforward. Have a database with logins/pass/etc and check if its a valid match. If it is, put a variable in their session to note that they are logged in, then on your page check for that variable, if its there and true, the display the "logged in" page.

If you want to keep track of everyone who is logged in at one time; I put a "last visit" on my members table and update that every time they hit a page. Then just assume everyone who has hit a page in the past 5 minutes and who hasnt explicitly logged out is "logged in" as far as other members are concerned.

Hope that helps
Jakarta
Jakarta
quote:
You sign on.


I suppose you as in your IP address.
Jakarta
Jakarta
I have no need for forum software I just want to make it for practice. Your reply was like replying "just play doom 3" to someone who asks a question about making a game.
Big B
Big B
Servlets keep track of Sessions for you. The default Session length is around 30mins, so you could just check how many active Sessions you have and thats what you say you have signed in.

Two points of advice for MySQL
1) Write all your database definitions in a text file, then load them on the command line. Or if you can get phpMyAdmin to work, then more power to you (I wasted too much time trying to get it working, and failed)
2) Write down your root password somewhere. It sucks having to reinstall because you forgot it.

Other than that have fun. Server side programming is pretty easy, its just setting stuff up thats a pain.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.