Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prevent unauthorized access

Status
Not open for further replies.

killerg

Programmer
Joined
Dec 2, 2006
Messages
15
Location
CY
also in the login how do we prevent the users
which their pass and email doesnt match to
login. i used the following sql and also iam trying some if statements but all the users can access even if their pass and email dont match.

Dim dbconn, sql, dbcomm, dbread
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("App_Data\Login.mdb"))
dbconn.Open()
sql = "SELECT Name FROM User_details WHERE Email = '" & mail.Text & "' AND 'Password'= '" & pass.Text & "' "
dbcomm = New OleDbCommand(sql, dbconn)
dbread = dbcomm.ExecuteReader()

 
i found the way :)

Dim dbconn, sql, dbcomm, dbread
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("App_Data\Bookshop.mdb"))
dbconn.Open()
sql = "SELECT * FROM User_details WHERE Email = '" & mail.Text & "' AND [Password]= '" & pass.Text & "' "
dbcomm = New OleDbCommand(sql, dbconn)
dbread = dbcomm.ExecuteReader()
Dim sName As String
While dbread.Read()

sName = dbread("Name")

Response.Redirect("Main.aspx?Value=" & sName)

End While



End Sub



this on the button load of the login page


and this is on the load of the main page

Dim sName As String


sName = Request.QueryString("Value")
Response.Write("Your name is " & sName)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top