Help - Search - Members - Calendar
Full Version: rip FIX MY ASP!
The Hammer Clan Forums > THC General Forums > General Discussion
Paytun
heres the link: http://cis001.rmu.edu/LocalUser/INFSHodnic...enter/login.asp

heres the code for my check login:

<% @LANGUAGE = "VBSCRIPT" %>

<%

<!--- Set Session variable --->
session("username") = request("username")

<!-- Declare Program variables -->
dim myConnection, myRecordSet, sqlString, filePath
dim strusername, strpassword

<!-- Create an istance of the ADO connectin Record Set Object -->
<!-- and assoicate them with the myConnection and myRecordSet variables -->
set myConnection = Server.CreateObject("ADODB.Connection")
set myRecordSet = Server.CreateObject("ADODB.RecordSet")

<!-- open the connection to the database -->
filePath = Server.MapPath("StudentCenter/student.mdb")
myConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +filePath)

<!-- Collect username and password from login.asp form -->
strusername = Request.Form("username")
strpassword = Request.Form("password")

<!-- Create a SQL string to Select all from the user table searching for username -->
sqlString = "Select * from tbluser where username = '" & strusername & "'"

<!-- execute the sql string --->
set myRecordSet = myConnection.Execute(sqlString)

If myRecordSet.eof then ' Username not found
Response.Redirect "login.asp?WrongUser=True" ' - Username wrong
ElseIf UCase(myRecordSet("password")) <> UCase(strpassword) Then
Response.Redirect "login.asp?WrongPW=True" ' - Username OK; password No
Else
Response.Redirect ("menuforregisteredusers.asp") ' - successful login
End If

<!--- close the recordset and the connection --->
myRecordSet.Close
myConnection.Close

Set myRecordSet = Nothing

%>






THANKS!
Lightyears
"Welcome to Student Service Center! At this cetner you can check your class registeration, academic standing and grades, and bills and payments."
nova912
tell me your problem with it.
Paytun
QUOTE("nova912")
tell me your problem with it.


Whenever I enter a username/password (even if its correct) it will bounce me to the checklogin.asp page which shouldn't happen... it should either send me back to the login page or to the menu page.
ripvaanwinkle
it sounds like a problem with variable type mismatches. give me a correct username and password so i can see what happens for myself
Raggnarock
Username: ball
Password: bl1569

BTW we are in the same class, and it doesnt work for me either.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.