SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need to uniquely identify users form series of forms, how?

    This is my setup, I have one form that is split up into three pages to speed up load time and decrease the sense of burden on the user.

    I want the user to be able to navigate freely throughout the three pages without losing any information, either for editing, accidently pushing the back button, etc.

    Because of the amount of information that is being submitted throught the forms, I'm using a database to store the values temporarily until the information is submitted (as opposed to using session variables).

    What I need to know is, how do I uniquely identify the users so that when they move from page to page, the correct informaiton is queried from the database?

    My idea was to use the primary key. I would add a new record for each new user, then create a cookie with the primary key attached to it. Then whenever the pages were loaded, they would search for the cookie and query the database.

    The problem with this that I am facing is, how do I capture the primary key of the new record that I just added? There is the potential for many users to be using the forms at the same time, so the EOF of the database may not work.

    Anyone have ideas?

  2. #2
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Presuming that we're talking about ASP here, could you not just use the Session Id instead of the primary key and store the Session Id in a table field as well? Of course, this'd only work if you using a single server.

    Couple of links for getting last record id:
    http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=79
    http://www.kamath.com/tutorials/tut007_identity.asp

  3. #3
    code addict Abstraction's Avatar
    Join Date
    Apr 2001
    Location
    Des Moines, IA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look into @@identity for getting the value of the autonumber just inserted inserted.

    http://www.4guysfromrolla.com/webtech/100598-1.shtml

  4. #4
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks guys.


Bookmarks

Posting Permissions

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