Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving User Info in ASP and Displaying it.

Status
Not open for further replies.

ZeoGel

Technical User
May 13, 2003
28
US
Hi I Like to have a field in my ASP page that would State the Name of the Current user. And a hidden field that would retrive their UserID & input it into a database when they submit a Form. Is there a way with either ASP or VB script to reteive this information?


Thank's
 
I am think of the first and Last name of the user who is access the ASP page. What i have is a Form on the page to be filled out. I would like to get their user info.
 
i understand...what i am trying to say is from where you want to get the user info??

do you have information stored somewhere in the database or do you want to connect to Active Directory and fetch information from there??

what you want to do??

-DNG
 
Or are you relying on the user to submit their own name on an HTML form .... and then you will insert the submitted names into a database?
 
-DNG
Oh I am sorry, Yes we have Active Directory and I would like to get it there.

-Sheco
I am tring not to have to people not double input that is why I want to get info from an Active Directory.
 
Ah, ok then first use the ServerVariables collection to pull out the value of LOGON_USER that was submitted along with the HTTP request... if it is empty just send back a 403 Forbidden and this will cause the browser to resend the Request along with the credentials.

Anyway, once you get the credentials just query the AD on the username to get the first and last name. Be aware that the AD fields might not have such obvious field names... for example sometimes last name will be sn ... which apparantly is an abbreviation for "surname".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top