Web Wiz - Green Windows Web Hosting

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

Login page

 Post Reply Post Reply
Author
skincla View Drop Down
Newbie
Newbie


Joined: 16 April 2003
Location: United Kingdom
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote skincla Quote  Post ReplyReply Direct Link To This Post Topic: Login page
    Posted: 16 April 2003 at 10:22am

Hi,

I am pretty new to ASP and am trying to create a login page for a site. The form sends the username and password to this page:

<%@LANGUAGE="VBScript"%>
<%
Response.Expires = -1000 'Makes the browser not cache this page
Response.Buffer = True 'Buffers the content so our Response.Redirect will work
Session("UserLoggedIn") = ""
Session("OwnerLoggedIn") = ""

' *** Connect to database***
Dim myConn

Set myConn = Server.CreateObject("ADODB.Connection")
myConn.open "Human","","dragon"

' *** Read the search form variable ***
Dim uName, uPassword

uName = CStr(Request("username"))
uPassword = CStr(Request("password"))

' *** get data ***
Dim mySQL

mySQL = "SELECT * FROM User WHERE Username = '"  & uName & "' AND Password = '"  & uPassword & "'"

' *** Record Set ***
Dim myRS

Set myRS = myConn.Execute(mySQL)

If myRS.BOF And myRS.EOF Then
Response.Redirect "index.htm"
Else
Session("UserLoggedIn") = "true"
If(myRS.Fields.Item("Security_ID").Value) = "2" then
Session("OwnerLoggedIn") = "true"
Response.Redirect "../Owner/OwnerPage.asp"
Else
Response.Redirect "UserPage.asp" & "?Userid=" & myRS("User_ID")
End if
End If
myConn.Close
Set myRS = Nothing
Set myConn = Nothing
%>

but the page won't display! (this page cannot be displayed) any ideas?

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

Joined: 30 May 2002
Location: Brazil
Status: Offline
Points: 560
Post Options Post Options   Thanks (0) Thanks(0)   Quote faubo Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2003 at 10:49am

turn off the Friendly Error Messages in your brownser options, this way you will see where is the problem in your code, and what the problem is.

Then we can help you.

Back to Top
 Post Reply Post Reply

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.