ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 4th, 2003, 02:39 PM
RavingRonin RavingRonin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Canada
Posts: 3 RavingRonin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy confirm Login no worky.

Basically I cannot get this baby to work other than to allow the GUEST ACCESS and the ADMIN ACCESS the MEMBER ACCESS I am not even sure if it is even connecting to the databse.

Here is the code for the CONFIRMLOGIN page and also the LIBRARY.INC page.

When Logging in as a MEMBER it simply redirects to the mainview page but as a GUEST. Ishn't dat vierd?

Any suggestions would be appreciated..........

Heres the ConfirmLogin.asp

<!--#include file="Library.inc"-->
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="refer.css">
<TITLE></TITLE>
<% Response.Buffer = true %>
<%
Username = request.form("txtUserName")
Password = request.form("txtPassword")
if Password = "letmein" and Username = "admin" then%>
<%response.clear%>
<%Response.Redirect "MainView.asp?user=admin"%>
<%
session("User_Id") = ""
session("UserName") = ""
session("FirstName") = ""
session("LastName") = ""
session("Street") = ""
session("City") = ""
session("Province") = ""
session("PostalCode") = ""
session("Telephone") = ""
session("Email") = ""
session("Password") = ""
%>
<% Else %>

<%
dim objrsUsers, sql
sql = "SELECT * FROM Users WHERE UserName = 'UserName';"
set objrsUsers = Server.CreateObject("ADODB.Recordset")
objrsUsers.Open sql, objConn
if objrsUsers.EOF then
response.clear
response.redirect"MainView.asp?user=guest"
else

if UserName = txtUserName and not objrsUsers.EOF then
session("bvaliduser") = (objrsUsers.Fields.Item("txtUserName").value)
'Response.cookies("ckLoggedin") = "Loggedin"
'response.clear
response.redirect"MainView.asp?user=member"%>

<%end if%><%end if%><%end if%>

Now heres the Library.Inc page

<!-- #Include file="adovbs.inc" -->
<%
dim objConn
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Library"


'if Session("bValidUser") = True and Session("UserID") = "" then
'dim rsPersonIDCheck
'set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset")
'dim strSQL
'strSQL = "SELECT User_ID FROM Users WHERE E_Mail = '" & Session("E_Mail") & "';"
'rsPersonIDCheck.Open strSQL, objConn
'if rsPersonIDCheck.EOF then
'Session("bValidUser") = False
'else
' Session("UserID") = rsPersonIDCheck("UserID")
'end if
'rsPersonIDCheck.Close
'end if
%>

Reply With Quote
  #2  
Old March 4th, 2003, 02:57 PM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
just for a start

In the ConfirmLogin.asp :

after the redirect,
session("User_Id") = ""
session("UserName") = ""
session("FirstName") = ""
session("LastName") = ""
session("Street") = ""
session("City") = ""
session("Province") = ""
session("PostalCode") = ""
session("Telephone") = ""
session("Email") = ""
session("Password") = ""

Never gets executed all these settings should happen before the redirect.



the query
sql = "SELECT * FROM Users WHERE UserName = 'UserName';"

will look for the text "UserName" in the DB not the value of UserName variable.

That's why you always get an empty record and get redirected as guest because

if objrsUsers.EOF then is TRUE

The query should be some thing like.

sql = "SELECT * FROM Users WHERE UserName = '" & UserName & "'"

Also you need to do some checking that the user didn't enter some thing that contains ' ...


if UserName = txtUserName and not objrsUsers.EOF then

txtUserName was never defined so it is a blank string.


I hope this is of any Help
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Reply With Quote
  #3  
Old March 4th, 2003, 03:08 PM
RavingRonin RavingRonin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Canada
Posts: 3 RavingRonin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks

Thanks alot Yassoor... I will give that a try....
Quite obviously I am a complete newbie.......

Reply With Quote
  #4  
Old March 4th, 2003, 04:30 PM
RavingRonin RavingRonin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Canada
Posts: 3 RavingRonin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have made the appropriate changes to the query ..... and made it so it now redirects the user back to the Login page if nothing is entered....

Now when the correct member info is entered it simply reloads the ConfirmLogin page..... which of course shows nothing........Weird?

RavingRonin

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > confirm Login no worky.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap