I have set up a user login system. Is there a way I can count the number of times a particular user logs in ?
Printable View
I have set up a user login system. Is there a way I can count the number of times a particular user logs in ?
You'll need a database...
then it's very easy.. just update the count field of the table when they login.
I think the easiest way would be to use the registry to store/REtreive the number from the registry.
Gl,Code:Dim x As Integer
'REtreive on form load
Private Sub Form_Load()
x = GetSetting("MyProgram", "save", "x", 0)
End Sub
'Store when loged in
Private Sub cmdLogin_Click()
x = x + 1
SaveSetting "MyProgram", "save", "x", x
End Sub
D!m
Well...
I agree with Monte96...
To make you easier, just try to make a table for User Login nd Password, and of course, add a field for Counter...
Cheers,
Wen Lie
This is not the type of info that should be written to the registry of the web server. It belongs in a database.
[Edited by monte96 on 10-08-2000 at 01:00 AM]
I don't think so either. By using the register a normal person can't manipulate the value.Quote:
Originally posted by monte96
This is not the type of info that should be written to the registry of the web server. It belongs in a daabase.
When you put it in an acces database, you can change the value in wathever you want.
Sorry for my poor english!
Well, that's not exactly why..
Data stored in the registry should only be things such as settings for an application. A web app should never need to write to the registry for the most part. The point of putting it in a database is that it can then be displayed on a web page and easily tracked.
Chill guys...I thought he was talking about the logining into his application and not some online based server. If that's the case then a db is a good idea.
D!m
sorry d!m.. didn't mean to get so militant about it :c)