Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to cut this variable down to size? 1

Status
Not open for further replies.

Ikyoto

IS-IT--Management
Aug 23, 2002
6
US
The authmethod script i'm using works perfectly...

<%authmethod = Request.ServerVariable (&quot;AUTH_TYPE&quot;)
username= Request.ServerVariable (&quot;AUTH_USER&quot;)%

The return (thanks to our Cisco router and Pix i believe) comes out as &quot;domain logged in through/username&quot; instead of just &quot;username&quot;.

Any suggestions on how to get rid of the crud to the left of the slash? Any amount of scripting will help. I just want the user name after AAA so I can give them what they should see instead of the site that is currently static.

TIA The only limitiation we have are those we are willing to accept.
 
Code:
'VBScript
l = Len(username)         'Length of the string
p = InStr(username, &quot;/&quot;)  'Position of slash
username = Right(username, (l - p) )

Code:
//JScript
l = username.length;           //Length of the string
p = username.indexOf(&quot;/&quot;);     //Position of slash
username = username.substring(p,l);
 
i tried it and can't seem to get it to trim properly. where and how would you insert this?

the current code is:

<%
username = Request.ServerVariables(&quot;AUTH_USER&quot;)
extra =Request.ServerVariables(&quot;HTTP_HOST&quot;)
%>

and later into the body of the doc to display:

<td colspan=&quot;13&quot; class=&quot;small_print&quot;>You are logged in as: <%= username %> from: <%= extra%></td>

the return is a ten character domain then the &quot;\&quot; and the user name.

Sorry if I'm being dence about this, but I've been up for 19 hours and have another 8 to go. this is just one of three projects due by the end of the month. The only limitiation we have are those we are willing to accept.
 
<%
username = Request.ServerVariables(&quot;AUTH_USER&quot;)
extra =Request.ServerVariables(&quot;HTTP_HOST&quot;)

l = Len(username)
p = InStr(username, &quot;/&quot;)
username = Right(username, (l - p) )
%>
.
.
.
<td colspan=&quot;13&quot; class=&quot;small_print&quot;>You are logged in as: <%= username %> from: <%= extra%></td> I hope that tomorow I'll still be alive and kicking.
 
perfect! Thanks to both of you! Now all I need is to be able to speed myself up to a measurable fraction of the speed of light and get everythign done within the time frame i have.... The only limitiation we have are those we are willing to accept.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top