Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Posts
    72

    Unanswered: Script to identify one row

    Hello

    What type of script would do this, please?

    I have an online database and, using classic ASP, it is shown in a Web form with various columns and rows such as:

    John Smith | 34343434 | smith.J@myEmail.com | description | action | date

    There are other rows of similar data.

    What I would like to do ideally is have a script whereby the user logs on with his email address and a unique password which would be exactly the same as the identifier in the row above (34343434). This would have been emailed to the user beforehand.

    Having completed the userID (user's email) field and the password (unique identifier) field, and on pressing 'submit' or 'log-on', this would
    take him to the status of his own record - just that one row - and no other. The other rows may or may not be present, but they would not be visible because that would only reveal details of other users.

    The purpose of this is to inform the user when he logs-on as to the status of his order (in the action column), such as 'received', or 'pending', etc.

    Thanks for any advice.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    So you know the user that's logged in. Let's say we're storing this in a session variable.

    So you just need to pass this session variable to your query as a parameter that is used to filter it to only the specific rows for that user.

    As an aside: I'm concerned that you've listed the password as the unique identifier. Are you suggesting that no two users can have the same password? Also, why isn't the users email the unique identifier?
    George
    Home | Blog

  3. #3
    Join Date
    Feb 2006
    Posts
    72
    Hello George

    Thank you for your message.

    So you just need to pass this session variable to your query as a parameter that is used to filter it to only the specific rows for that user.
    That sounds a little complicated but I think you mean that the script stores the user's ID/password which is filtered to view only that row which relates to his ID/password? Do you have an example?

    The example I gave in my first post referred to the unique identifier as being the order number and no order number would ever be the same, but the use of an email address as the unique identifier would be suitable, too.

    Thank again, George.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Session variables: ASP Session object

    An example of querying a database: AJAX Database
    (scroll down to the section labelled "The ASP File")

    * * *

    Here's how I'd approach the problem from the ground up:
    1) Create a log in form (or equivalent) from the user so I can get their unique identifier
    2) Once I've got the unique identifier, build up a query in ASP and pass the unique identifier as a parameter
    3) Execute the query and show the results to the user.
    George
    Home | Blog

  5. #5
    Join Date
    Feb 2006
    Posts
    72
    Hello George

    Many thanks for your post and sorry for the time taken to reply.

    Thanks, too, for the links - I'll get to work right away.

    Quetzal

Posting Permissions

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