Remove domain from request.servervariables("LOGON_USER")

D

Dave Karmens

How can I remove the domain name and the \ from
request.servervariables("LOGON_USER") ?

Remove everything up to, and include the \ ...
 
R

Ray at

Here's one of many ways:

aName = Split("\" & Request.ServerVaribles("LOGON_USER"), "\")
sName = aName(UBound(aName))

Ray at work
 
R

Rob Meade

...
How can I remove the domain name and the \ from
request.servervariables("LOGON_USER") ?

Remove everything up to, and include the \ ...

Perhaps;

<%
Dim aName
Dim strName

' create an array by splitting variable by the \
aName = Split(Request.ServerVariables("LOGON_USER"), "\")

' populate variable
strName = aName(UBound(aName))

' clear down
aName Erase

' display to screen
Response.Write strName
%>

Assumptions are that you have actually returned something in that server
variable - if not it'll error - you'll need to put some additional checks
around this perhaps.

Hope this helps,

Regards

Rob
 
D

Dave Karmens

thanks guys :)

Ray at said:
Here's one of many ways:

aName = Split("\" & Request.ServerVaribles("LOGON_USER"), "\")
sName = aName(UBound(aName))

Ray at work
 
R

Roland Hall

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top