Skip to main content
Inspiring
April 17, 2007
Question

Request.Servervariables help needed

  • April 17, 2007
  • 1 reply
  • 218 views
Hi,

I'm using the following code to reutrn the username of an authenticated
user:

<%=Request.ServerVariables("AUTH_USER")%>

The value this is returned is in the format domain\username

How can I change this so that it just returns the username and not the
domain?

Thanks,

Mintyman

P.S. I'm using ASP on IIS 6.0


This topic has been closed for replies.

1 reply

Inspiring
April 17, 2007
You can't, as the domain is an integral part of identifying a user properly.
You can use Split, or a combination of Right and InStr to get just the user
name portion afterward, but the server variable will always have both.


"Mintyman" <mintyman@ntlworld.com> wrote in message
news:f022u9$ihh$1@forums.macromedia.com...
> Hi,
>
> I'm using the following code to reutrn the username of an authenticated
> user:
>
> <%=Request.ServerVariables("AUTH_USER")%>
>
> The value this is returned is in the format domain\username
>
> How can I change this so that it just returns the username and not the
> domain?
>
> Thanks,
>
> Mintyman
>
> P.S. I'm using ASP on IIS 6.0
>