Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How do I do that?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mafifi
Junior Member

USA
308 Posts

Posted - 24 June 2001 :  12:28:53  Show Profile  Send mafifi an ICQ Message
I have an ASP application running on an Intranet site that captures the Request.ServerVariables("REMOTE_USER").
The result will look something like this mydomain.com\user_Name. How do I strip the mudomain.com\ part and keep the user_name part.

Thanks,

Mo

Doug G
Support Moderator

USA
6493 Posts

Posted - 24 June 2001 :  18:34:51  Show Profile
If the return data is always <domain> \ <user> you can use something like:

arr = Split(string, "\")

Then, arr(0) will be the domain name, and arr(1) will be the user name.


======
Doug G
======
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 24 June 2001 :  19:47:45  Show Profile  Send mafifi an ICQ Message
Thanks Doug G. I also found this code somewhere in the forum.
 
<%
istring = "Request.ServerVariables("REMOTE_USER")"
istring = Right(istring, Len(istring)-Instr(istring, "\"))
response.write istring
%>


My home server is down, so I will try it at work tomorrow.

Thanks,

Mo
Go to Top of Page

MorningZ
Junior Member

USA
169 Posts

Posted - 24 June 2001 :  21:08:50  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
quote:
I have an ASP application running on an Intranet site that captures the Request.ServerVariables("REMOTE_USER").
The result will look something like this mydomain.com\user_Name. How do I strip the mudomain.com\ part and keep the user_name part.
Thanks,
Mo


also

pos = InstrRev( Request.ServerVariables("REMOTE_USER"), "\" ) + 1
Username = Mid( Request.ServerVariables("REMOTE_USER"), pos )

( i totally dig the InstrRev function, very very handy a lot of times )



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07