开发者

Do you need to include the full https file name to use SSL on html/php forms?

<form action="purchase.php" method="post"> is the code I use on my payments form. Do I nee开发者_高级运维d to include the entire https://domainname.com in order to use ssl in my form?


If you begin from http://domainname.com, your form will submit to http://domainname.com/purchase.php

If you begin from https://domainname.com, your form will submit to https://domainname.com/purchase.php

So the client browser needs to be using the https:// protocol from the page the form is within to use https. (ie, relative paths use the page's http(s) protocol).


No, you don't, as you are using a relative url. Relative URLs imply using the same domain and such.


No. Using HTTPS doesn't change the way relative URIs work.

(You do, of course, have to serve the page containing the form over HTTPS in the first place though, otherwise the relative URI is relative to an HTTP page — but if the form is served over HTTP is is subject to modification en-route, so you need to be serving it with HTTPS anyway).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜