drmcm84800 2011-05-24 05:04
浏览 68
已采纳

如何在php中检查页面是从http或https调用的

Just wondering, will it be possible we can check whether the page is call from http or https in php?

Example: If I call to a page call customer.php by the following link http://customer.php, will it be possible to check in php and tell the page is from http.. also if I call the page from the following link https://customer.php, will it be possible to check in php and tell the page is from https??

  • 写回答

3条回答 默认 最新

  • doujia2090 2011-05-24 05:06
    关注

    Try to look at:

    if (!empty($_SERVER['HTTPS'])) {
        // https is enabled
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误