If the request was sent with HTTPS you will have a extra parameter in the $_SERVER superglobal – $_SERVER[‘HTTPS’]. You can check if it is set or not
if( isset($_SERVER['HTTPS'] ) ) {
More Related Contents:
- PHP global in functions
- php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
- What is the difference between HTTP_HOST and SERVER_NAME in PHP?
- MySQLi prepared statements error reporting [duplicate]
- How to pass $_GET variables from a link to a bootstrapmodal?
- Generating (pseudo)random alpha-numeric strings
- FPDF error: Some data has already been output, can’t send PDF
- A form doesn’t submit [duplicate]
- Laravel-5 ‘LIKE’ equivalent (Eloquent)
- Connect to a MySQL server over SSH in PHP
- php array behaving strangely with key value 07 & 08
- How to store NULL values in datetime fields in MySQL?
- UTF-8 encoded html pages show � (questions marks) instead of characters
- Constructor returning value?
- How to send 500 Internal Server Error error from a PHP script
- PHP how to retrieve array values
- Creating csv file with php
- Stop script execution upon notice/warning
- Add some html to Zend Forms
- php share variable among different users/sessions
- What does the syntax ‘%s’ and ‘%d’ mean as shorthand for calling a variable?
- Updating php version on mac
- PCRE regular expression overlapping matches
- Get “Content-Type” header of request in PHP
- MySQL/SQL retrieve first 40 characters of a text field?
- file_get_contents returns empty string
- How to convert MySQL time to UNIX timestamp using PHP?
- Laravel change locale not working
- is $_SERVER[‘HTTP_REFERER’] safe?
- Insert non-English decimal points in mysql