By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

http to https

P: n/a
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!!!

Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gazing into my crystal ball I observed "dave" <fo****@foo.netREMOVE>
writing in news:#n**************@TK2MSFTNGP15.phx.gbl:
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
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.