Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Login Code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Login Code

 Post Reply Post Reply Page  12>
Author
IrishNewbie View Drop Down
Newbie
Newbie


Joined: 06 November 2003
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote IrishNewbie Quote  Post ReplyReply Direct Link To This Post Topic: Login Code
    Posted: 12 November 2003 at 2:25pm

Hey,

You know if i want to make a login feature on my site, i need to get the user to enter a ID no and password which are in the DB.

So i set up the connection and what would my query be??

when i say something like, Select Pword From Students Where etc. where does the value of Students.Pword get stored and how can i access it for authenticating the login??

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 2:28pm

From this set of tutorials

Comes this section, Security

at some point you are going to have to do some research on your own instead of just leaning on a message board to solve every problem :-/

Contribute to the working anarchy we fondly call the Internet
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 2:37pm

I agree with MorningZ, but I've made something like this anyway, so here it is

Alright, you'll have to create a connection, a command, and a reader, like this.

Imports System.Data.OleDb

Public Function Login(UserId As String)

Dim DbConnection As New OleDbConnection, DbCommand As New OleDbCommand, DbReader As OleDbDataReader, LoginSucces As Boolean

With DbConnection

  'The connection string
  .ConnectionString = ""
  'Open the connection
  .Open()

End With

'Initialize the database command
With DbCommand

   .CommandText = "SELECT Pword FROM tblStudent WHERE UserId = '" & UserId & "'"

End With

Try

  DbReader = DbCommand.ExecuteReader()
  While DbReader.Read

     LoginSucces = True

  End While
  DbReader.Close

Catch

  LoginSucces = False

End Try

DbConnection.Close()

End Function

BTW, you're starting to look like mZeb, which is not a compliment. Please try it yourself first, and don't private message AND post a topic.

Gone..
Back to Top
IrishNewbie View Drop Down
Newbie
Newbie


Joined: 06 November 2003
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote IrishNewbie Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 2:57pm

For your information I have tried it myself and cant solve the problem of figuring out away of using the value returned when i search for the pword in the table.

And morning Z ive looked at those tutorials and they gave me some of the ideas im using.

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 3:00pm
BTW, it isn't really safe, by just validating on one id without a password.
Gone..
Back to Top
IrishNewbie View Drop Down
Newbie
Newbie


Joined: 06 November 2003
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote IrishNewbie Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 3:02pm
what do you mean??
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 3:06pm

What I mean is, when you login, you'll have to find a combination between an user name and a password. That'll be harder then just guessing an user ID, which is probably a logic ID (so all the students have the same kind of id, but are slightly different).

That way it isn't really a 'Login', since you can just guess what kind of ID someone else has, and enter that.

Gone..
Back to Top
IrishNewbie View Drop Down
Newbie
Newbie


Joined: 06 November 2003
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote IrishNewbie Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2003 at 3:12pm
its my intention to use a Username/Password algorithm not just asking the student for their ID number.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.