Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > http to https

Reply
Thread Tools

http to https

 
 
dave
Guest
Posts: n/a
 
      12-07-2004
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!!!



 
Reply With Quote
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      12-07-2004
Gazing into my crystal ball I observed "dave" <(E-Mail Removed)>
writing in news:#(E-Mail Removed):

> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP SOAP/HTTP GET/HTTP POST milan_9211 Software 0 01-10-2011 02:10 PM
server side redirect https => https NOT working Axel ASP General 8 04-27-2009 02:02 AM
https authentication & storing https page in string Naveen Dhanuka Ruby 1 09-19-2007 02:05 PM
open-uri and HTTPS, or net/https with a redirect jotto Ruby 4 10-02-2006 07:26 AM
HTTP to HTTPS aftab ASP .Net 2 10-03-2004 06:21 PM



Advertisments