473,412 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Convert auth_user to Lower Case & Remove Domain Name

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
4 2730
Rabbit
12,516 Expert Mod 8TB
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
yeah its syntax that is throwing me....I need to see the actual snippet & pop it in
Nov 21 '11 #3
Rabbit
12,516 Expert Mod 8TB
Give it a shot and post back what you get.
Nov 21 '11 #4
jhardman
3,406 Expert 2GB
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).

Jared
Nov 23 '11 #5

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

Similar topics

22
by: DJ | last post by:
Can someone tell me the library call that converts strings to lower case or retrns a new string that is lower case of the original, thanks im using <string> David
3
by: MHenry | last post by:
All the lower case "c" in my database table are now upper case "C" starting in January 2004. All prior data is fine. I just noticed this after installing a Microsoft update patch a couple of days...
17
by: Janice | last post by:
char* line = "abcd"; How to convert the line to upper case and print? Any option for printf to do this? Thanx
4
by: jimdscudder | last post by:
I am using a file watcher to watch for files changing. My problem is: the string file info returned is all LOWER CASE. Below is the important part of the code? Any suggestions? using...
19
by: Eric Lindsay | last post by:
Should HTML 4.01 Strict markup be done in upper case or in lower case? I understand that HTML allows either upper or lower case. I also notice that XHTML apparently requires lower case. However I...
2
by: Franky | last post by:
This should be easy to find but I've been looking and looking at the doc and can't find it. Maybe it can't be done. In the IDE editors find/replace I want to use regular expression to change the...
14
by: fniles | last post by:
In VB.NET 2005 can I check if a letter in a string is upper case or lower case ? For example: I have the following 2 lines: NQ,Z2003,11/11/2003,1416.5,1420,1402,1411.5...
2
by: Ronald S. Cook | last post by:
I'd like your opinion on whether or not form names should be lower or mixed case (like is there a "best practice" for the style). http://www.mysite.com/Employee.aspx?Number=123456 vs ...
5
by: cfmx2008 | last post by:
Hi Guys, I hope you could help me to solve this problem. Here it is: I have a huge table of data. Some data are Lower case and some are upper case. these data could be changed by agents, But I want...
6
by: lenniekuah | last post by:
Hullo Awesome Helpers, Thank you for helping me earlier. I am back with new problem. I am trying to covert a TEXT String into either Lower and Upper case characterS. (Upper case Eg. ALFRED instead...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.