• <tfoot id='GJv2n'></tfoot>
      <bdo id='GJv2n'></bdo><ul id='GJv2n'></ul>
    <i id='GJv2n'><tr id='GJv2n'><dt id='GJv2n'><q id='GJv2n'><span id='GJv2n'><b id='GJv2n'><form id='GJv2n'><ins id='GJv2n'></ins><ul id='GJv2n'></ul><sub id='GJv2n'></sub></form><legend id='GJv2n'></legend><bdo id='GJv2n'><pre id='GJv2n'><center id='GJv2n'></center></pre></bdo></b><th id='GJv2n'></th></span></q></dt></tr></i><div id='GJv2n'><tfoot id='GJv2n'></tfoot><dl id='GJv2n'><fieldset id='GJv2n'></fieldset></dl></div>

    <small id='GJv2n'></small><noframes id='GJv2n'>

  • <legend id='GJv2n'><style id='GJv2n'><dir id='GJv2n'><q id='GJv2n'></q></dir></style></legend>

        用 PHP 检测 SSL

        时间:2023-09-20

            <tfoot id='20hbd'></tfoot>

                <tbody id='20hbd'></tbody>
                <bdo id='20hbd'></bdo><ul id='20hbd'></ul>

                • <legend id='20hbd'><style id='20hbd'><dir id='20hbd'><q id='20hbd'></q></dir></style></legend>

                  <small id='20hbd'></small><noframes id='20hbd'>

                  <i id='20hbd'><tr id='20hbd'><dt id='20hbd'><q id='20hbd'><span id='20hbd'><b id='20hbd'><form id='20hbd'><ins id='20hbd'></ins><ul id='20hbd'></ul><sub id='20hbd'></sub></form><legend id='20hbd'></legend><bdo id='20hbd'><pre id='20hbd'><center id='20hbd'></center></pre></bdo></b><th id='20hbd'></th></span></q></dt></tr></i><div id='20hbd'><tfoot id='20hbd'></tfoot><dl id='20hbd'><fieldset id='20hbd'></fieldset></dl></div>
                  本文介绍了用 PHP 检测 SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  可能的重复:
                  如何确定是否使用 HTTPS$_SERVER['HTTPS']

                  我在网上四处寻找检测服务器是否使用 HTTPS 连接的方法,但似乎没有一个站点拥有所有的答案(以及一些不同的答案).检测服务器是否使用与 PHP 的 HTTPS 连接的所有方法究竟是什么?我需要知道几种检测 SSL 的方法,因为我的一些脚本被重新分发,并且不同的服务器处理事情的方式不同.

                  I went looking around the web for ways to detect if a server is using an HTTPS connection, but no one site seemed to have all the answers (and some different ones). What exactly are all the ways to detect if a server is using an HTTPS connection with PHP? I need to know several ways to detect SSL as some of my scripts are redistributed and various servers handle things differently.

                  推荐答案

                  $_SERVER['HTTPS']

                  如果脚本是通过 HTTPS 协议查询的,则设置为非空值.
                  注意:请注意,在 IIS 中使用 ISAPI 时,如果请求不是通过 HTTPS 协议发出的,则该值将 off.

                  Set to a non-empty value if the script was queried through the HTTPS protocol.
                  Note: Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol.

                  http://www.php.net/manual/en/reserved.variables.server.php

                  因此,这样做:

                  if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
                      // SSL connection
                  }
                  

                  这篇关于用 PHP 检测 SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:登录必须是 https 页面 下一篇:占位符的 PDO 有效字符

                  相关文章

                  最新文章

                  1. <tfoot id='yPNjt'></tfoot>

                      <legend id='yPNjt'><style id='yPNjt'><dir id='yPNjt'><q id='yPNjt'></q></dir></style></legend>
                    1. <small id='yPNjt'></small><noframes id='yPNjt'>

                      <i id='yPNjt'><tr id='yPNjt'><dt id='yPNjt'><q id='yPNjt'><span id='yPNjt'><b id='yPNjt'><form id='yPNjt'><ins id='yPNjt'></ins><ul id='yPNjt'></ul><sub id='yPNjt'></sub></form><legend id='yPNjt'></legend><bdo id='yPNjt'><pre id='yPNjt'><center id='yPNjt'></center></pre></bdo></b><th id='yPNjt'></th></span></q></dt></tr></i><div id='yPNjt'><tfoot id='yPNjt'></tfoot><dl id='yPNjt'><fieldset id='yPNjt'></fieldset></dl></div>

                      • <bdo id='yPNjt'></bdo><ul id='yPNjt'></ul>