Help with log in

Results 1 to 2 of 2

Thread: Help with log in

  1. #1
    Join Date
    Dec 1969

    Default Help with log in

    I am trying to set up an ASP ecommerce web with a user login verified from a SQL Server DB, I am for the most part ok with this part of the web(lots of examples). I need to however to, once the person logs in, retieve their shipping/billing info that I have stored in the DB into a form that once they are ready to check out gets automatically filled with their details . I am not sure how to do this. Can somebody please help or give me any idea of how I can get this to work?

  2. #2
    Joel M Guest

    Default RE: Help with log in

    The Best technique that I can think of to accomplish what I think you&#039re trying to to grab the information from the database when you first open the checkout form page...<BR><BR>Assuming you haven&#039t already done this...I would suggest putting their UserID into a session variable...then grab that Value at the top of the page, and insert it into your SQL statment like so:<BR>-------------------<BR><BR>if session("userID") = "" then<BR> response.redirect("login.asp?msg=Please Log In")<BR>end if<BR><BR>&#039Connect to the DB<BR><BR>sql = "SELECT * FROM usersinfo WHERE userID = "& session("UserId")<BR><BR>set rs= Conn.Execute(sql)<BR>---------------------------------<BR><BR>Then once you have that recordset, you can go through and populate the initial value paramaters of the so:<BR>---------------------------------<BR>&#060;input type="text" name="name" value="&#060;%= rs("name") %&#062;"&#062;<BR><BR>&#060;input type="text" name="address" value ="&#060;%= rs("address") %&#062;"&#062;<BR><BR>---------------------------------<BR>and if you prefer this info not to be editable...just throw the values into a hidden form field, and then print the values to screen as HTML....<BR><BR>hope it helps<BR>Joel

Posting Permissions

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