Q:

Write a PHP script, to check whether the page is called from 'https' or 'http'

0

Write a PHP script, to check whether the page is called from 'https' or 'http'.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
if (!empty($_SERVER['HTTPS'])) 
{
  echo 'https is enabled';
}
else
{
echo 'http is enabled'."\n";
}
?>

Sample Output:

http is enabled

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now