request.querystring(please help!!)

Results 1 to 7 of 7

Thread: request.querystring(please help!!)

  1. #1
    Join Date
    Dec 1969
    Posts
    465

    Default request.querystring(please help!!)

    Hi<BR>I am trying to pass a variable a = "books & music" through a URL and i see that it is going thru alright. But, when i call it in the page required as b = request.querystring("a") i can see only books and not the remaining field. Please help ASAP as the application is ready to be launched..<BR>Shaila

  2. #2
    Join Date
    Dec 1969
    Posts
    28

    Default RE: request.querystring(please help!!)

    query string variables (ie: a) are deliniated by the ampersand (&) the best thing to do is to use URLEncode prior to passing the query string.

  3. #3
    Join Date
    Dec 1969
    Posts
    28

    Default RE: request.querystring(please help!!)

    URLencode is a method of the server object (check out help if you need more info). There exista a URLDecode reoutine that can be located on the somewhere on the wrox book site (www.wrox.com). Good luck

  4. #4
    Join Date
    Dec 1969
    Posts
    465

    Default RE: request.querystring(please help!!)

    i tried doing it, that is i called it on the next page using x = server.urlencode(request.querystring("a"))<BR>wher e a = "books & music". i think i&#039ve it wrong so could u please guide me thru. tried searching wrox site in vain!! PLease help!!!<BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    465

    Default i got it! thanx a lot!!

    Hi Pablo,<BR> Thanx a lot for your help!! i got it working!!!<BR>Thanx a million!!

  6. #6
    Join Date
    Dec 1969
    Posts
    28

    Default RE: request.querystring(please help!!)

    you need to urlencode it on the page you are using the anchor.<BR>Try and separate the var ("this & that") into a var<BR>Dim QStrVar<BR>QStrVar = ("A=this & that")<BR>THEN<BR>response.write("&#060;A HREF=http://PAGE.ASP?" & QStrVar & "&#062;click here&#060;/A&#062;"<BR>

  7. #7
    Lodewijk Guest

    Default RE: request.querystring(please help!!)

    Hi Shaila,<BR><BR>the venom lies in the querystring method which causes you problems. This is designed to work with the GET method and not the POST method which doesn&#039t have problems with &#039&&#039 signs and others. <BR>The querystring method just chops of after encountering end OR some invalid character (such as &).<BR><BR>I guess your fastest solution is to try to use the Request.Form method which should give you the entire querystring or the value of the object if you specify one. Perhaps you have to change to a POST method where you had a GET, it is up to you to choose this.<BR><BR>Hint: try to use the POST method as much as possible as it keeps your URL clean ( not rubbish seen at the URL location in the browser) and permits you to send wierd characters without problems.<BR><BR>Hopefully this helps you out,<BR><BR>smile<BR>Lodewijk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •