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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to retrieve data from a url?

Status
Not open for further replies.

jfdabiri

MIS
Feb 27, 2007
282
US
ok, i changed the hta's into html's. i can see the url's on the top of the new window when the page is displayed like this:
file:///H:/public/updateDB.html?email=jerry@isp.net&model=T40&row=1
on this page, i have vbscript. all i want to do is retrieve email and model. how would i code in vb script to retrieve these two items. i know how to do it in asp by using request.querystring, but html and vbscript does not like that object.
thanks.
 
Code:
<script language="vbscript">
  sQueryString = Document.Location.search
  arrNameValuePairs = Split(sQueryString,"&")
  
  sEmailValue = Split(arrNameValuePairs(0),"=")
  MsgBox sEmailValue(1)
  sModelValue = Split(arrNameValuePairs(1),"=")
  MsgBox sModelValue(1)
</script>
 
thanks laeq
actually i found out that the way to get the whole url string is my_string = LOCATION.HREF
this gives you the whole string. but no variable names. is there a way to name the variables by name? like email? model? in my example?
thanks.
 
Not that I am aware of, it's just down to string manipulation once you get the part of the URL you are looking for
 
just for fyi.
there's no technology on the client side such as REQUEST.QUERYSTRING. the correct syntax for retrieving url data is LOCATION.HREF
this will give you the whole url string which has to be parsed to get the item(s) needed.
cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top