473,386 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Login page should work, but....

Invisible Bunny King
Hi.
I am mostly a Dreamweaver user as opposed to a coder, so bear with me.
I have created a login page for my site. On my testing server, everything worked perfectly. It would look for the user in an Access table and either welcome them, or send them to an error if their info is not found. However, when I put the site on my real server...... problems.
Below is the code to my login page. To me, it should work, so I hope someone can look at it and find the error. Sorry for all the sily MM_ stuff, that's a Macromedia thing.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@LANGUAGE="VBSCRIPT"%>
  3. <!--#include file="Connections/hockeycards.asp" -->
  4. <%
  5. ' *** Validate request to log in to this site.
  6.  
  7. sConnection="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(dbPath) & ";"%>
  8.  
  9. MM_LoginAction = Request.ServerVariables("URL")
  10. If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
  11. MM_valUsername=CStr(Request.Form("Uname"))
  12. If MM_valUsername <> "" Then
  13.   MM_fldUserAuthorization="AccessLevel"
  14.   MM_redirectLoginSuccess="welcome.asp"
  15.   MM_redirectLoginFailed="sorry.asp"
  16.   MM_flag="ADODB.Recordset"
  17.   set MM_rsUser = Server.CreateObject(MM_flag)
  18.  
  19.   MM_rsUser.Source = "SELECT Uname, Pass"
  20.   If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  21.   MM_rsUser.Source = MM_rsUser.Source & " FROM CustomerList WHERE Uname='" & Replace(MM_valUsername,"'","''") &"' AND Pass='" & Replace(Request.Form("Pass"),"'","''") & "'"
  22.   MM_rsUser.CursorType = 0
  23.   MM_rsUser.CursorLocation = 2
  24.   MM_rsUser.LockType = 3
  25.   MM_rsUser.Open
  26.   If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 
  27.     ' username and password match - this is a valid user
  28.     Session("MM_Username") = MM_valUsername
  29.     If (MM_fldUserAuthorization <> "") Then
  30.       Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
  31.     Else
  32.       Session("MM_UserAuthorization") = ""
  33.     End If
  34.     if CStr(Request.QueryString("accessdenied")) <> "" And false Then
  35.       MM_redirectLoginSuccess = Request.QueryString("accessdenied")
  36.     End If
  37.     MM_rsUser.Close
  38.     Response.Redirect(MM_redirectLoginSuccess)
  39.   End If
  40.   MM_rsUser.Close
  41.   Response.Redirect(MM_redirectLoginFailed)
  42. End If
  43. %>
Thanks in advance to anyone who can help me.
Invisible Bunny King
Feb 20 '07 #1
4 1744
MMcCarthy
14,534 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@LANGUAGE="VBSCRIPT"%>
  3. <!--#include file="Connections/hockeycards.asp" -->
  4. <%
  5. ' *** Validate request to log in to this site.
  6.  
  7. sConnection="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(dbPath) & ";"%>
  8.  
Sorry if this is obvious but have you changed the value stored in dbPath?

Mary
Feb 20 '07 #2
Mary,
Thanks for the reply.
I'm not 100% sure what you mean by "value".
However, I can say that dbPath is exactly the same as every other page on my site. It works everywhere else, so I assume that is not the problem.
Any other thoughts?

Expand|Select|Wrap|Line Numbers
  1.  
  2. <%@LANGUAGE="VBSCRIPT"%>
  3. <!--#include file="Connections/hockeycards.asp" -->
  4. <%
  5. ' *** Validate request to log in to this site.
  6.  
  7. sConnection="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(dbPath) & ";"%>
  8.  
Sorry if this is obvious but have you changed the value stored in dbPath?

Mary
Feb 20 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Mary,
Thanks for the reply.
I'm not 100% sure what you mean by "value".
However, I can say that dbPath is exactly the same as every other page on my site. It works everywhere else, so I assume that is not the problem.
Any other thoughts?
The only reason I can see that it would fail on the server if it is working on your machine is if it's not pointing to the right location for the database. I'm afraid that as it's working elsewhere I can't think of any Access reason for it not to be working so I am assuming a DW or Web problem. I will ask some other experts to have a look.

Mary
Feb 21 '07 #4
Yes, that was the first thing I changed. I knew that when I ULed my site, I would have to change the location of the database in my connection string. It took a load of work, and a ton of recoding on each page, but I finally got that working. Unfortunately, it's not as simple as a wrong location.

The only reason I can see that it would fail on the server if it is working on your machine is if it's not pointing to the right location for the database. I'm afraid that as it's working elsewhere I can't think of any Access reason for it not to be working so I am assuming a DW or Web problem. I will ask some other experts to have a look.

Mary
Feb 21 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: RT | last post by:
I have followed the step by step instructions in the login manual Created login page Use LSC01 This works - login and get redirected to the proper page My problem is the cookie variables...
4
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for...
1
by: frekster | last post by:
All, Windows xp pro box with vs 2003 and .net 1.1 installed. Downloaded a project from source safe via vpn to my ome pc to work from home. I have three other projects on my pc that works fine...
6
by: BizWorld | last post by:
Hi, I have a scenario where i need to configure only Login.aspx page to use SSL. All other application will run on HTTP protocol. If someone can guide me how to accomplish this. One of my idea...
7
by: Samuel Shulman | last post by:
Is there a method that will indicate the person who logged successfully is Logged and therefore allowed to browse freely other then using the...
5
by: guy | last post by:
I am not a web developer so this is probably easy! in a web app i have a login page if a user logs in, does stuff, logs out - which takes them back to the login page - how do i stop a new user...
1
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database -...
2
by: Sasquatch | last post by:
I'm still having trouble creating a simple login page using the asp:login control. I followed some instructions in a WROX book, "Beginning ASP.NET 2.0," and the instructions are very straight...
2
by: IdleBrain | last post by:
Hello All: I used a Login control to authenticate a user to login. The problem is that when I login with good username & password, the login view would say that the login was successful. But...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.