需要判断代码运行环境是否是HTTPS服务器,只需要判断_SERVER[‘HTTPS’]是否打开即可
if ($_SERVER['HTTPS'] != "on") { echo "This is not HTTPS"; }else{ echo "This is HTTPS"; }
需要判断代码运行环境是否是HTTPS服务器,只需要判断_SERVER[‘HTTPS’]是否打开即可
if ($_SERVER['HTTPS'] != "on") { echo "This is not HTTPS"; }else{ echo "This is HTTPS"; }