how do I get URL contents after the question mark?

E

Eugene

Hi!

This seems to be a newbie question. I hope this is not an off-topic
question, actually didn't know where to place it - at sripting.vbscript or
here.

I have a form using the GET method. After submitting, a new URL is
generated, e.g.:

http://www.abc.com/index.htm?type=finance&section=accrual

I have tried document.location and document.url, but these properties return
only the first part of my URL - http://www.abc.com/index.htm

What is the best way of checking the inputted data in vbscript?
The page will be running locally, not on a web server.

Thanks for any help.
 
E

Eugene

I'm sorry I was wrong with document.location: putting the update function
into body onload event works ok:

<body onload="checkitout()">
<form>...</form>
<script>
function checkitout()
msgbox document.location
end function
</script>
</body>

But still want to hear about other options. I guess, there might be some
elegant solutions to do this.

Thanks,
Eugene
 
S

SL

Is this what you need? Request.QueryString["parameterID"]
hope the code below may help you

protected void Page_Load(object sender, EventArgs e)
{
string Type1 = Request.QueryString["type"];
string Section1 = Request.QueryString["section"];
Response.Write(Type1);
Response.Write(Section1);
}

Output :
finance
accrual
 
E

Eugene

Exactly. But is there a vbscript solution to do the same?

Thanks,
Eugene

SL said:
Is this what you need? Request.QueryString["parameterID"]
hope the code below may help you

protected void Page_Load(object sender, EventArgs e)
{
string Type1 = Request.QueryString["type"];
string Section1 = Request.QueryString["section"];
Response.Write(Type1);
Response.Write(Section1);
}

Output :
finance
accrual


Eugene said:
Hi!

This seems to be a newbie question. I hope this is not an off-topic
question, actually didn't know where to place it - at sripting.vbscript or
here.

I have a form using the GET method. After submitting, a new URL is
generated, e.g.:

http://www.abc.com/index.htm?type=finance§ion=accrual

I have tried document.location and document.url, but these properties return
only the first part of my URL - http://www.abc.com/index.htm

What is the best way of checking the inputted data in vbscript?
The page will be running locally, not on a web server.

Thanks for any help.
 
S

Stefan B Rusynko

See http://www.w3schools.com/asp/asp_ref_request.asp

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Exactly. But is there a vbscript solution to do the same?
|
| Thanks,
| Eugene
|
| "SL" wrote:
|
| > Is this what you need? Request.QueryString["parameterID"]
| > hope the code below may help you
| >
| > protected void Page_Load(object sender, EventArgs e)
| > {
| > string Type1 = Request.QueryString["type"];
| > string Section1 = Request.QueryString["section"];
| > Response.Write(Type1);
| > Response.Write(Section1);
| > }
| >
| > Output :
| > finance
| > accrual
| >
| >
| > "Eugene" wrote:
| >
| > > Hi!
| > >
| > > This seems to be a newbie question. I hope this is not an off-topic
| > > question, actually didn't know where to place it - at sripting.vbscript or
| > > here.
| > >
| > > I have a form using the GET method. After submitting, a new URL is
| > > generated, e.g.:
| > >
| > > http://www.abc.com/index.htm?type=finance§ion=accrual
| > >
| > > I have tried document.location and document.url, but these properties return
| > > only the first part of my URL - http://www.abc.com/index.htm
| > >
| > > What is the best way of checking the inputted data in vbscript?
| > > The page will be running locally, not on a web server.
| > >
| > > Thanks for any help.
| > >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top