Need Help with query strings!

Results 1 to 5 of 5

Thread: Need Help with query strings!

  1. #1
    Madellaine Guest

    Default Need Help with query strings!

    Hi,<BR>I just learned how to pass a query string and it&#039s pretty simple so far. Problem is, I need to implement this into a login format. My users need to login and put in their password, and their e-mail, name, phone, and address needs to be passed to the next page!!!! These are all categories in my Access database, I just don&#039t know how to pass this information if they don&#039t enter it in themselves!!! Will someone please help? I would be forever greatful!

  2. #2
    duc Guest

    Default RE: Need Help with query strings!

    I like to help you out but I don&#039t quite to understand what do you mean by they not input the information in the form. Well if they don&#039t input the information in the first form don&#039t even let them go into the second page. You can do this by java script.<BR>duc

  3. #3
    Madellaine Guest

    Default RE: Need Help with query strings!

    Hello again, sorry for the confusion. I have their email address, home address, phone number, etc. on an MSAccess database. These are "hidden". When they login, all they do is enter in their username and password, and it brings them to another page that says,<BR>Welcome: John Doe<BR>Is this Your address?: 123 Easy Street<BR>Is this your phone number?: 555-1212<BR><BR>So, this info somehow needs to be pulled from the fields on my Access database and be passed onto the next page somehow!!! Thank you for your help<BR>--Madellaine

  4. #4
    Join Date
    Dec 1969

    Default RE: Need Help with query strings!

    You need a login page with a form for the username and password and the form method should be POST and the action something like &#039loginverification.asp&#039. On &#039loginverification.asp&#039, grab the username and password from the request.form(&#039theNameOfTheField") for each field, build a SQL query like "select email_address, home_address, phone_number from whatevertable where username = &#039" & usernameVariable & "&#039 and password = &#039" & passwordVariable & "&#039", create a recordset from the SQL string and grab your email address, home address, phone number from the recordset. <BR>There are some good examples here - <BR>

  5. #5
    Madellaine Guest

    Default RE: Need Help with query strings!

    Thanks for your help, but I am still having problems! Here is the login code that I am using:<BR><BR>Sub CheckLogin<BR>Dim Conn, cStr, sql, RS, username, userpwd<BR>username = Request.Form("username")<BR>userpwd = Request.Form("userpwd")<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>cStr = "DRIVER={Microsoft Access Driver (*.mdb)};"<BR>cStr = cStr & "DBQ=" & Server.MapPath ("fpdb est.mdb") & ";" <BR>Conn.Open(cStr)<BR>sql = "select username from UserTable where username = &#039" & LCase(username) & "&#039"<BR>sql = sql & " and userpwd = &#039" & LCase(userpwd) & "&#039" <BR>Set RS = Conn.Execute(sql)<BR>If RS.BOF And RS.EOF Then<BR> Error_Msg = "Login Failed. Try Again."<BR> ShowLogin<BR>Else<BR> Session("UserLoggedIn") = "true"<BR> Response.Redirect "loggedin.htm"<BR>End If<BR>objConn.Close<BR>Set objConn = Nothing<BR>End Sub<BR>%&#062;<BR><BR><BR>How exactly would I write ask the computer to look up the person&#039s e-mail address, home address, and phone number from the Access Database? Where would I enter this stuff in? THANK YOU!!!<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts