http to https

D

dave

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!!!
 
A

Adrienne Boswell

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://

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top