thinkphp Source Learning---is_ssl () function to determine whether the SSL protocol

Source: Internet
Author: User

/**
* Determine if the SSL protocol
* @return Boolean
*/

function Is_ssl () {if (Isset ($_server[' https ') ') && (' 1 ' = = $_server[' HTTPS ') | |    ' on ' = = Strtolower ($_server[' HTTPS '))) {return true; }elseif (Isset ($_server[' Server_port ") && (' 443 ' = = $_server[' Server_port '])) {//HTTPS Use port 443 retu    RN true; } return false;}


1.$_server[' server_port '] get HTTPS port

2.https Port 443 HTTP port 80

This article is from the "11400485" blog, please be sure to keep this source http://11410485.blog.51cto.com/11400485/1833383

thinkphp Source Learning---is_ssl () function to determine whether the SSL protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.