久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='xaEVY'></bdo><ul id='xaEVY'></ul>

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

      1. <i id='xaEVY'><tr id='xaEVY'><dt id='xaEVY'><q id='xaEVY'><span id='xaEVY'><b id='xaEVY'><form id='xaEVY'><ins id='xaEVY'></ins><ul id='xaEVY'></ul><sub id='xaEVY'></sub></form><legend id='xaEVY'></legend><bdo id='xaEVY'><pre id='xaEVY'><center id='xaEVY'></center></pre></bdo></b><th id='xaEVY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xaEVY'><tfoot id='xaEVY'></tfoot><dl id='xaEVY'><fieldset id='xaEVY'></fieldset></dl></div>
        <legend id='xaEVY'><style id='xaEVY'><dir id='xaEVY'><q id='xaEVY'></q></dir></style></legend><tfoot id='xaEVY'></tfoot>
      2. 如何在沒有 $_SERVER['HTTPS'] 的情況下確定您

        How to find out if you#39;re using HTTPS without $_SERVER[#39;HTTPS#39;](如何在沒有 $_SERVER[HTTPS] 的情況下確定您是否使用 HTTPS)
        • <bdo id='GgZt8'></bdo><ul id='GgZt8'></ul>
              <tbody id='GgZt8'></tbody>

          1. <i id='GgZt8'><tr id='GgZt8'><dt id='GgZt8'><q id='GgZt8'><span id='GgZt8'><b id='GgZt8'><form id='GgZt8'><ins id='GgZt8'></ins><ul id='GgZt8'></ul><sub id='GgZt8'></sub></form><legend id='GgZt8'></legend><bdo id='GgZt8'><pre id='GgZt8'><center id='GgZt8'></center></pre></bdo></b><th id='GgZt8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GgZt8'><tfoot id='GgZt8'></tfoot><dl id='GgZt8'><fieldset id='GgZt8'></fieldset></dl></div>

            <legend id='GgZt8'><style id='GgZt8'><dir id='GgZt8'><q id='GgZt8'></q></dir></style></legend>
            <tfoot id='GgZt8'></tfoot>

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

                1. 本文介紹了如何在沒有 $_SERVER['HTTPS'] 的情況下確定您是否使用 HTTPS的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在網上看到很多教程說你需要檢查 $_SERVER['HTTPS'] 如果服務器的連接是用 HTTPS 保護的.我的問題是,在我使用的某些服務器上,$_SERVER['HTTPS'] 是一個未定義的變量,會導致錯誤.是否有另一個我可以檢查的變量應該始終定義?

                  為了清楚起見,我目前正在使用此代碼來解析它是否是 HTTPS 連接:

                  if(isset($_SERVER['HTTPS'])) {if ($_SERVER['HTTPS'] == "on") {$secure_connection = 真;}}

                  解決方案

                  即使 $_SERVER['HTTPS'] 未定義,這也應該始終有效:

                  function isSecure() {返回(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')||$_SERVER['SERVER_PORT'] == 443;}

                  代碼與 IIS 兼容.

                  來自 PHP.net 文檔和用戶評論:

                  <塊引用>

                  1. 如果腳本是通過 HTTPS 協議查詢的,則設置為非空值.

                  2. 請注意,將 ISAPI 與 IIS 一起使用時,該值將為關閉";如果請求不是通過 HTTPS 協議發出的.(對于作為 Fast-CGI 應用程序運行 PHP 的 IIS7,已報告了相同的行為).

                  此外,即使安全連接,Apache 1.x 服務器(和損壞的安裝)也可能沒有定義 $_SERVER['HTTPS'].雖然不能保證,但根據約定,端口 443 上的連接很可能使用 安全套接字,因此需要額外的端口檢查.

                  附加說明:如果客戶端和您的服務器之間存在負載均衡器,則此代碼不會測試客戶端與負載均衡器之間的連接,而是測試負載均衡器與您的服務器之間的連接.要測試之前的連接,您必須使用 HTTP_X_FORWARDED_PROTO 標頭進行測試,但這樣做要復雜得多;請參閱此答案下方的最新評論.

                  I've seen many tutorials online that says you need to check $_SERVER['HTTPS'] if the server is connection is secured with HTTPS. My problem is that on some of the servers I use, $_SERVER['HTTPS'] is an undefined variable that results in an error. Is there another variable I can check that should always be defined?

                  Just to be clear, I am currently using this code to resolve if it is an HTTPS connection:

                  if(isset($_SERVER['HTTPS'])) {
                      if ($_SERVER['HTTPS'] == "on") {
                          $secure_connection = true;
                      }
                  }
                  

                  解決方案

                  This should always work even when $_SERVER['HTTPS'] is undefined:

                  function isSecure() {
                    return
                      (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
                      || $_SERVER['SERVER_PORT'] == 443;
                  }
                  

                  The code is compatible with IIS.

                  From the PHP.net documentation and user comments :

                  1. Set to a non-empty value if the script was queried through the HTTPS protocol.

                  2. Note that when using ISAPI with IIS, the value will be "off" if the request was not made through the HTTPS protocol. (Same behaviour has been reported for IIS7 running PHP as a Fast-CGI application).

                  Also, Apache 1.x servers (and broken installations) might not have $_SERVER['HTTPS'] defined even if connecting securely. Although not guaranteed, connections on port 443 are, by convention, likely using secure sockets, hence the additional port check.

                  Additional note: if there is a load balancer between the client and your server, this code doesn't test the connection between the client and the load balancer, but the connection between the load balancer and your server. To test the former connection, you would have to test using the HTTP_X_FORWARDED_PROTO header, but it's much more complex to do; see latest comments below this answer.

                  這篇關于如何在沒有 $_SERVER['HTTPS'] 的情況下確定您是否使用 HTTPS的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環)
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數)
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“localhost的訪問被拒絕)
                    <bdo id='dw4dg'></bdo><ul id='dw4dg'></ul>
                    <i id='dw4dg'><tr id='dw4dg'><dt id='dw4dg'><q id='dw4dg'><span id='dw4dg'><b id='dw4dg'><form id='dw4dg'><ins id='dw4dg'></ins><ul id='dw4dg'></ul><sub id='dw4dg'></sub></form><legend id='dw4dg'></legend><bdo id='dw4dg'><pre id='dw4dg'><center id='dw4dg'></center></pre></bdo></b><th id='dw4dg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dw4dg'><tfoot id='dw4dg'></tfoot><dl id='dw4dg'><fieldset id='dw4dg'></fieldset></dl></div>

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

                    1. <legend id='dw4dg'><style id='dw4dg'><dir id='dw4dg'><q id='dw4dg'></q></dir></style></legend>

                          <tbody id='dw4dg'></tbody>

                          • <tfoot id='dw4dg'></tfoot>

                            主站蜘蛛池模板: 日韩三级免费网站 | 综合精品久久久 | 91成人免费看片 | 国产精品毛片无码 | 国产精品国产三级国产aⅴ中文 | 97国产爽爽爽久久久 | 国产9久| 鲁视频 | 久久免费国产视频 | 国产成人午夜精品影院游乐网 | 台湾a级理论片在线观看 | 在线观看亚洲一区二区 | 日韩精品免费一区二区在线观看 | 国产激情在线观看 | 国产在线精品一区二区三区 | 国产激情在线 | 国产一区二区三区四区五区加勒比 | 亚洲黄色一区二区三区 | 国产日韩精品一区二区 | 涩涩视频在线观看免费 | 国产精品久久毛片av大全日韩 | 国产一区二区三区在线 | 亚洲vs天堂 | 国产福利观看 | 97国产精品视频人人做人人爱 | 欧美黄色网络 | 成人av播放 | 久久高清 | 国产精品视频一区二区三 | 在线观看av网站 | av免费看片 | av一级久久 | 欧美成人第一页 | 亚洲毛片| 午夜免费成人 | 欧美大片一区 | 亚洲视频在线免费观看 | 亚洲一区中文字幕在线观看 | 国产精品一区二区三区在线 | 中文字幕一区二区三区四区 | 亚洲欧洲中文 |