PHP verifique si la URL es HTTP o HTTPS

if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
    $link = "https";
else
    $link = "http";
Wicked Weevil