Forums

This topic is locked

Help retrieving logged in user details PLEASE!!

Posted 29 Apr 2002 21:49:56
1
has voted
29 Apr 2002 21:49:56 Ferd Ferd posted:
I have recently made an e-commerce website where users have to login before they can put items into the basket. They can view items without logging in but not add to basket.

The next stage is the checkout stage where I want users to add their payment details to the the name and address that are already stored in the custober table of the database.

How do i retrieve the details of the user that is logged in ?

I think it has something to do with session variables but I have NO idea how to use them. Can somebody please explain where I need to make/put these session variables. If any source code needs to be edited then please could someone tell me exactly where to add these statements as I have no knowledge of HTML either.

I know it's asking a lot but I really hope someone can help.

Thanks in advance.

Ferd
email and msn:

Replies

Replied 29 Apr 2002 23:19:09
29 Apr 2002 23:19:09 Dennis van Galen replied:
hi Ferdy,

Are you using the standard login behavior ?

If so, it creates a session called MM_Username

you can print this value out by using this command in a .asp page:
<%= Session("MM_Username" %>

put that anywhere between <body> </body> and you will see the name of the person logged in, knowing this we can also filter a recordset with this session.

In your recordset (simple view) set the filter to your username column and make sure it filters using a session then type in your sessionname in the textfield next to the pull down thingy to select your filtermethod.
make the filter look as it does in this image, using your own user column offcourse:
dennisvg.homeip.net/UDzone/FilterBySession.gif

You use this same method for a page where users can change their information.

With kind regards,

Dennis van Galen
Webmaster KPN Services
Financial and Information Services

Reply to this topic