2

Possible Duplicate:
Use PHP to check if page was accessed with SSL

Is there any way to show up few menus only when the SSL is active with php?

Thanks

Community
  • 1
  • 1
FlourishDNA
  • 503
  • 1
  • 8
  • 18

1 Answers1

3

You can check to see if $_SERVER['HTTPS'] is an empty string or not:

if(!empty($_SERVER['HTTPS']))
{
    echo '<a href="#">Secure Login</a>';
}
Tim Cooper
  • 151,519
  • 37
  • 317
  • 271