Check if URL is HTTPS in PHP

/ Published in: PHP
Save to your folder(s)

Check if URL is HTTPS

Copy this code and paste it in your HTML
  1. <?php
  3. if ($_SERVER['HTTPS'] != "on") {
  4. echo "This is not HTTPS";
  5. }else{
  6. echo "This is HTTPS";
  7. }
  9. <?

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.