SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist cms9651's Avatar
    Join Date
    Mar 2010
    Posts
    407
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Response redirect and querystring

    hi there, hope in your help.
    I've this code in classic asp:
    Code:
    Response.Redirect(
    h t t p: // 10.XX.XX.XX/whois/default_2.asp?ref=http://www.myhosting.net/?aE=MD&dt=17/04/2013&z=IR+RDT)
    the code working but the browser show:
    Code:
    h t t p: // www.myhosting.net/?aE=MD
    Why you will lose the other variables in querystring 'dt' and 'z' ?
    Can you help me?
    Thanks in advance.
    Thanks you very much for your help
    I'm really happy for your quickly answer.
    Good bye

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    OH, USA
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is sounds like problem in h t t p: // 10.XX.XX.XX/whois/default_2.asp...
    do you have code for that?

  3. #3
    SitePoint Evangelist cms9651's Avatar
    Join Date
    Mar 2010
    Posts
    407
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    many thanks, this is the code of page default_2.asp:
    Code:
    <%
    strUSER = Request.ServerVariables("AUTH_USER")
    strID = Request.Querystring("strID")
    strReferer = Request.Querystring("ref")
    %>
    
    <html>
    <head>
    <script language="JavaScript">
    function redirect()
    { 
       document.form.submit()
    } 
    </script>
    </head>
    
    <body onLoad="redirect()">
    <form method="POST" name="form" action="http://www.myhosting.net/index_2.asp">
        <input type="hidden" name="USER" value="<%=strUSER%>">   
        <input type="hidden" name="ID" value="<%=strID%>"> 
        <input type="hidden" name="referer" value="<%=strReferer%>">
       </form>
    </body>
    
    </html>
    Thanks you very much for your help
    I'm really happy for your quickly answer.
    Good bye

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    OH, USA
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so default_2.asp just read query string, put to hidden variables and submit form to
    http://www.myhosting.net/index_2.asp you can check if you get right values by comment out one line of javascript.

    <script language="JavaScript">
    function redirect()
    {
    // document.form.submit()
    }
    </script>
    it will stop redirect and give you blank page, but if you right click and view source you should see
    <input type="hidden" name="referer" value="http://www.myhosting.net/?aE=MD&dt=17/04/2013&z=IR+RDT">
    if it is there look on source for http://www.myhosting.net/index_2.asp
    I.m not sure why you doing that, one thing is aware it is goes from querystring to hidden field and back to querystring...
    what code in index_2.asp?

  5. #5
    SitePoint Member
    Join Date
    Jan 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    take a look at the difference: what you put as your redirect:
    Response.Redirect(
    h t t p: // 10.XX.XX.XX/whois/default_2.asp?ref=http://www.myhosting.net/?aE=MD&dt=17/04/2013&z=IR+RDT)

    and that is how it should look like:

    Response.Redirect("http://10.XX.XX.XX/whois/default_2.asp?ref=http://www.myhosting.net/?aE=MD&dt=17/04/2013&z=IR+RDT",false)

    and for better performance I would use URL encode function for the following part:"http://www.myhosting.net/?aE=MD&dt=17/04/2013&z=IR+RDT"


Bookmarks

Posting Permissions

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