http to https

Discussion in 'ASP General' started by dave, Dec 7, 2004.

  1. dave

    dave Guest

    Hello
    I have one simple form (myform.asp) and it posts to query.asp
    I had put below code in both file on top of the page to redirect this two
    pages in https://
    so any one can access it thru http , it changes to https://
    if Request.ServerVariables("HTTPS") = "off" then
    method = Request.ServerVariables("REQUEST_METHOD")
    srvname = Request.ServerVariables("SERVER_NAME")
    scrname = Request.ServerVariables("SCRIPT_NAME")
    sRedirect = "https://" & srvname & scrname
    sQString = Request.Querystring
    if Len(sQString) > 0 Then sRedirect = sRedirect & "?" & sQString
    if method = "POST" then
    Response.Write "<form method=post action=" & _
    sRedirect & " name='f'>"
    for x = 1 to Request.Form.Count()
    tname = Request.Form.Key(x)
    tvalue = Server.HTMLEncode(Request.Form.Item(x))
    Response.Write "<input type=hidden name=" & _
    tname & " value=""" & _
    tValue & """>" & vbCrLf
    next
    Response.Write "<input type=submit value=Go></form>"
    Response.Write "<script>" & vbCrLf
    Response.Write "document.f.submit();" & vbCrLf
    Response.Write "</script>"
    else
    Response.Redirect sRedirect
    end if
    end if

    but in myform.asp, it sth like this
    <form method="post" action="query.asp"></form>

    I'm just wondering whether its submits the form to query.asp via normal http
    and then redirect and resubmit itself thru https or its really transmitting
    form info via https:// (from myform.asp to query.asp)

    or do i need put action="https://mydomain.com/query.asp" in the form tag...

    Any help would be appreciated!!!
    dave, Dec 7, 2004
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed "dave" <>
    writing in news:#:

    > Hello
    > I have one simple form (myform.asp) and it posts to query.asp
    > I had put below code in both file on top of the page to redirect this
    > two pages in https://


    <snip>

    > but in myform.asp, it sth like this
    > <form method="post" action="query.asp"></form>
    >
    > I'm just wondering whether its submits the form to query.asp via
    > normal http and then redirect and resubmit itself thru https or its
    > really transmitting form info via https:// (from myform.asp to
    > query.asp)
    >
    > or do i need put action="https://mydomain.com/query.asp" in the form
    > tag...
    >
    > Any help would be appreciated!!!
    >



    Usually, I do this on the link that goes to the form,
    eg. <a href="https://www.example.com/myform.asp">Secure Form</a> then I
    don't have to worry about it, otherwise, you would have to explicitly
    state the absolute URL in the action attribute.

    Once someone is on a secured URL, they stay that way until you bring 'em
    out.

    Take a look at the menu at http://www.scriptassist.com/ and you'll see
    the only link that's https is buy.asp, and going from buy.asp to any
    other page will return you back to http.

    --
    Adrienne Boswell
    Please respond to the Group so others can share
    Adrienne Boswell, Dec 7, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aftab

    HTTP to HTTPS

    aftab, Sep 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,361
    Leon Mayne [MVP]
    Oct 3, 2004
  2. Raymond Tam

    HTTPS to HTTP

    Raymond Tam, Aug 5, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    563
    Marco Scheel
    Aug 6, 2003
  3. Axel
    Replies:
    8
    Views:
    1,061
    Adrienne Boswell
    Apr 27, 2009
  4. jotto
    Replies:
    4
    Views:
    373
    jotto
    Oct 2, 2006
  5. Naveen Dhanuka
    Replies:
    1
    Views:
    263
Loading...

Share This Page