$x = substr($_SERVER['HTTP_REFERER'],0,5);
if($x =="http:") { $protokol = "http://"; } else { $protokol="https://"; }
Ziyaretçinin referer bilgisinden ayıklama yaparsak hangi protokol ile geldiğini görmüş oluruz. Yukarıdaki kodu deneyin