By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

Convert auth_user to Lower Case & Remove Domain Name

P: 2
Can anyone help me. I have a small set of code that gets the windows user name & sets it into a URL. The URL then passes that to a browser login & logs my users in (this already works). The small problem I am having is I need to convert the username to Lower case & strip out the doamin name, so that I end up with just the raw lowercase indows username. This is what I have so far. I am sure its just my syntax as I have done this before but it was a long time ago.

Expand|Select|Wrap|Line Numbers
  1. username=<%Response.Write(Request.ServerVariables("AUTH_USER"))%>">
Nov 21 '11 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 10K+
P: 12,370
LCASE() will convert a string to lower case.
MID() will pull a substring out of a string.
INSTR() will find the index of the backslash character in the string.
Nov 21 '11 #2

P: 2
yeah its syntax that is throwing me....I need to see the actual snippet & pop it in
Nov 21 '11 #3

Expert Mod 10K+
P: 12,370
Give it a shot and post back what you get.
Nov 21 '11 #4

Expert 2.5K+
P: 3,405
The other thing that's throwing you off is the response
.Write. That prints the text to the screen, that doesn't help you for a variable assignment. Take out the response.write and the code delimiters, you are already in code so those are no good
Expand|Select|Wrap|Line Numbers
  1. username=request.servervariables("auth_user")
rabbit is right, you then need a combination of lcase() and something to whittle the string down. I personally would use instr() (to find the position of the @ or \) and right(str, n) (Gives you the right-most n characters of the string).

Nov 23 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.