473,327 Members | 2,065 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,327 software developers and data experts.

Parse Server Variable

I have a server variable that is being called from an aspx page in a WSS site. I need to find a way to remove part of the variable before passing it to the URL. The server variable is LOGON_USER... TIA
Aug 18 '09 #1
8 2811
tlhintoq
3,525 Expert 2GB
You're going to have to give the volunteers here a little more to go on. Some of the code in question helps.

I have a server variable... LOGON_USER
Nobody here will know if your variable is a string, an int, a custom object...
Aug 18 '09 #2
Frinavale
9,735 Expert Mod 8TB
If it's a string then you can just use a regular expression to extract whatever it is you need from it.
Aug 18 '09 #3
The variable LOGON_USER is in format: acct01\username. I only need the information after the backslash to pass through a URL (username).
Aug 24 '09 #4
tlhintoq
3,525 Expert 2GB
@doublestack
Did you try Frinavale's suggestion?
If it's a string then you can just use a regular expression to extract whatever it is you need from it.
You could also use the String.Split method which will give you an array of strings
Aug 24 '09 #5
Sorry for the delay in response, was on vacation...

I have never used the String.Split Method and am unfamiliar with its use. Can you give an example of how it is used to parse data out of a variable?
Sep 8 '09 #6
Frinavale
9,735 Expert Mod 8TB
Doublestack,

This is very simple string manipulation. You can use Regular Expressions (which are a little more complicated and you could probably avoid in this case) or use the String.Split() method. (Here's a link that shows how to use regular expressions in JavaScript)

The String.Split() method returns an array of strings by spliting the string based on a delimiter provided...

So if mystring contains "acct01\username"...then you would split on "\" and the array returned would be ["acct01',"username"].

I'd link you to the MSDN library for help on the String class but I can't access it right now.

Here's a link to the JavaScript string.split() method....you can even try using the string.split() method before using it in your code if you want.

String manipulation is one of the first things you learn as a programmer...it's one of the favorite things for tests and stuff at school. You really should familiarize yourself with it.

-Frinny
Sep 8 '09 #7
tlhintoq
3,525 Expert 2GB
@doublestack
One of the best places to see how something like this is to be used and to get an explanation is the source.
http://msdn.microsoft.com/en-us/libr...ing.split.aspx
Sep 8 '09 #8
Thanks for the info Frinny and Tlhintoq! I will give it a try and left you know if I run into any problems
Sep 11 '09 #9

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

Similar topics

2
by: John A. Irwin | last post by:
I'm very new to PHP and am trying to figure out how to parse out a variable "HTTP_REFERER". My reason for this is my site was recently "FEATURED" (sic) on a website called FARK.COM. Because of...
5
by: Kevin Joseph | last post by:
I have written a Perl script to modify some files over the network. All PCs are Win2k. Most of the files reside on a share in the form of \\server\share_name. Some of the files are on dirves in the...
6
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to...
1
by: Lelle | last post by:
sorry for crossposting im not sure i was in the right group hello i want to parse/rplace/construct wahtever a string i get i read with directoryinfo out the root off my webapplikation Dim...
4
by: firstcustomer | last post by:
Hi, I'm wanting to have a very simple page with the facility to do as follows: The user inputs some data into the text box, and clicks a button The user is then submitted to a url depending...
5
by: js | last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss". I need to parse the text using System.DateTime.Parse() function with custom format. I got an error using the following code. ...
3
by: bb nicole | last post by:
Below is the code i create when i click on the job title hyperlink, it will display the job information where call from database. But the error message is: Parse error: parse error, unexpected $end...
13
by: bobc | last post by:
In my stored procedure, I want to parse @ArrayOfDays into @d1 through @d5. @ArrayOfDays is a varchar input parameter containing, for example, "1.7.21.25.60." - five elements. Most active...
3
by: Leighya | last post by:
Im currently working on this xml file but when i load it to Mozilla, i got an error "Error Loading Stylesheet: Xpath parse failure: invalid variable name" It loads on IE properly. Only with the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.