[Beta] Loginsystem

Posts 115 of 34 · Page 1 of 3
[Beta] Loginsystem
Hello MPGH.

~ Information ~

I created a system within VB.Net and PHP to easily manage a login system including
  • Login System
  • Registration System
  • Bansystem
  • Activation System


Important: THIS SYSTEM DOES WORK WITH DATABASES THAT DO NOT ALLOW EXTERNAL ACCESS!!!

You can therefore use any free database in the ********* rather than paying for one that allows external access.
The whole system works locally, so it does not require any external access.

It is very easy to setup and use.

~ Files ~
  • SBox.dll(library to easily access everything)
  • admin.php
  • register.php
  • conn.php
  • login.php
  • activate.php
  • isbanned.php
  • banuser.php
  • install.php
  • Full dll project
  • Example project for usage


Note: Rename the admin.php/banuser.php!



~ Setup ~

1. Upload all .php files to your website using any ftp client(f.e. Filezilla) or your CPanel.

2. Browse the install.php in your webbrowser www.websitelink.com/install.php

Set your information like this:



If you are done, simply hit "Save"(obvious). If no error appears, everything is fine

The whole database stuff is already done, awesome eh?

~ Library Usage ~

1. Add the library as reference



2. Code sample

[php]Public Class frmMain

Private login As New Loginsystem("http://localhost/login")

Private Sub cmdRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRegister.Click
If login.ValidateEmail(txtem.Text) Then
Dim str As String = login.Register(txtid.Text, txtpw.Text, txtem.Text)
If str.Trim = "True" Then
MsgBox("Account " + txtid.Text + " successfully created.")
'you should now send an email using the library with the activationlink included
Else
MsgBox(str)
End If
Else
MsgBox("Invalid email address.")
End If
End Sub

Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
If login.Login(txtLid.Text, txtLpw.Text) Then
MsgBox("Success.")
Else
MsgBox("Failed.")
End If
End Sub

End Class
[/php]

~ Function Overview ~



~ Database Overview ~

users - This table contains all users

  • ID[INT(11)] - Auto Increment - Primary Key
  • Username[VARCHAR(30)]
  • Password[VARCHAR(255)]
  • Email[VARCHAR(50)]
  • IP[VARCHAR(30)]
  • HWID[VARCHAR(20)]
  • ActivationLink[VARCHAR(50)]
  • Activated[VARCHAR(12)]
  • Banned[VARCHAR(6)]



~ Requirements ~

  • .Net Framework 2.0
  • A MySQL database
  • A Brain


~ License ~

You may merge it into your program but only with credits.

If you have any further ideas on what can be added into this system, please let me know.

All rights reserved to me.

~ Virusscans ~
VirusTotal
Jotti


Enjoy this
Loginsystem.rarattachment deleted · 87 downloads before removal
Nice, nice, nice.
Did he ever released smth. useless?
nice, next thing you should do is tell us how to edit individual cells of a table in mysql through vb

but so far, pretty epic D:
Quote Originally Posted by mnpeepno2 View Post
nice, next thing you should do is tell us how to edit individual cells of a table in mysql through vb

but so far, pretty epic D:
[php]
Dim cmdStr As String = "UPDATE JasonsTable SET ColumnName='new value' WHERE key='identifier to row'"
Dim newCMD As New MySQLCommand(cmdStr, MySQLConnection)
newCMD.ExecuteNonQuery
[/php]

Done.
Quote Originally Posted by mnpeepno2 View Post
nice, next thing you should do is tell us how to edit individual cells of a table in mysql through vb

but so far, pretty epic D:
###############################################
###############################################

A small explanation on querys:

There are 4 basic commands:

SELECT
UPDATE
INSERT
DELETE


~ Select ~

SELECT Column,Column FROM Tablename WHERE Column='Condition' AND Column='Condition'
SELECT id,HWID,GUID FROM userlog WHERE PCName='Hawk' AND IP='127.0.0.1'

Note: To select ALL columns you may just use "*"
=> SELECT * FROM userlog


~ Logical Operators ~

You can use AND,XOR,OR

AND = If both conditions are true
WHERE Column="Condition" AND Column='Condition'

OR = if atleast one condition is true
WHERE Column="Condition" OR Column='Condition'

XOR = if ONE condition is true
WHERE Column="Condition" AND Column='Condition'
If both conditions are true, it won't select anything


~ Update ~

UPDATE Tablename SET Column='Value', Column='Value'
UPDATE userlog SET HWID='asd465asd6a4sd', GUID='asd546wqda5d4'

You can sure use WHERE here, too.
UPDATE userlog SET HWID='asd465asd6a4sd', GUID='asd546wqda5d4' WHERE ID='1'

~ Insert ~

INSERT INTO Tablename(Column,Column) VALUES(Value,Value)
INSERT INTO userlog(HWID,GUID) VALUES('asdgiqwdqgwdu','asdgiawzdgqq')


~ Delete ~

DELETE Column,Column FROM Tablename WHERE Column='Condition'
DELETE id,HWID,GUID FROM userlog WHERE login='1'

Note: To delete the whole row you DO NOT use "*"

DELETE FROM Tablename WHERE... <- no "*"


~ Wildcard ~

You can use % as wildcard.

SELECT * FROM userlog WHERE Date='2/2/2010' AND Time='%' <- Time can now be everything
SELECT * FROM userlog WHERE Date='2/2/%' XOR Time='11:%'

~ ORDER BY ~

You can order the result ascending or descending.

SELECT * FROM userlog ORDER BY GUID ASC
SELECT * FROM userlog ORDER BY HWID DESC

~ Limit ~

You can limit the amount of results.

SELECT * FROM userlog ORDER BY IP ASC LIMIT 10
This will select the first 10 rows.

SELECT * FROM userlog ORDER BY GUID DESC LIMIT 5,10
This will select 10 rows after the 5th row.

~ IN ~

SELECT * FROM userlog WHERE id IN('1','5','6')
This will select all rows with the id 1,5 and 6.

~ Other operators ~

You can also use < or >.

SELECT * FROM userlog WHERE id > '10'

I do hope you understood everything

###############################################
###############################################

If you guys have any further ideas to improve this,please tell me...
Yep, helped a lot....
I think this is pretty good no need to improve anything
Wow, this is awesome! Good job!
Thanks for the feedback.

Working on the next system(system ain't gonna be public(prolly)) for CoD
One more question, how would you search for a specific value in the database
Quote Originally Posted by mnpeepno2 View Post
One more question, how would you search for a specific value in the database
You can select the rows where a certain value is found in a certain column if that's what you mean.

[php]
Dim cmdStr As String = "SELECT * FROM JasonsTable WHERE columnName='RequiredValue'"
Dim newCMD As New MySQLCommand(cmdStr, MySQLConnection)
Using dRead As MySqlDataReader = newCMD.ExecuteReader
Do
dim col1 As String = dRead("column1Name")
dim col2 As String = dRead("column2Name")
'...
MessageBox.Show(String.Concat(col1, ControlChars.CrLf, col2))
Loop While dRead.Read
End Using
[/php]
Quote Originally Posted by Jason View Post


You can select the rows where a certain value is found in a certain column if that's what you mean.

[php]
Dim cmdStr As String = "SELECT * FROM JasonsTable WHERE columnName='RequiredValue'"
Dim newCMD As New MySQLCommand(cmdStr, MySQLConnection)
Using dRead As MySqlDataReader = newCMD.ExecuteReader
Do
dim col1 As String = dRead("column1Name")
dim col2 As String = dRead("column2Name")
'...
MessageBox.Show(String.Concat(col1, ControlChars.CrLf, col2))
Loop While dRead.Read
End Using
[/php]
thank joo, that is all.
Why can't you make a new thread and ask MySQL stuff there, instead of derailing Kevin's thread?

Good release Kevin!
Posts 115 of 34 · Page 1 of 3
This thread is closed for replies.

Tags for this Thread

None

Need help?