테스트 사이트 - 개발 중인 베타 버전입니다

php http접속과 https접속을 구별어떻게 하나요? 채택완료

주니1 8년 전 조회 8,065

php  http접속과 https접속을 구별어떻게 하나요? 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
굿
8년 전

</p><p><span style="color: rgb(85, 119, 153);"><?php</span>  </p><p> <span style="color: rgb(0, 136, 0); font-weight: bold;">if</span> (<span style="color: rgb(0, 112, 32);">isset</span>(<span style="color: rgb(153, 102, 51);">$_SERVER</span>[<span style="background-color: rgb(255, 240, 240);">'HTTPS'</span>]) <span style="color: rgb(51, 51, 51);">&&</span> <span style="color: rgb(153, 102, 51);">$_SERVER</span>[<span style="background-color: rgb(255, 240, 240);">'HTTPS'</span>] <span style="color: rgb(51, 51, 51);">!=</span> <span style="background-color: rgb(255, 240, 240);">'off'</span>) </p><p>{  </p><p><span style="color: rgb(153, 102, 51);"><font color="#000000">   </font>$protocol</span>  <span style="color: rgb(51, 51, 51);">=</span> <span style="background-color: rgb(255, 240, 240);">"https"</span>; </p><p> </p><p>} <span style="color: rgb(0, 136, 0); font-weight: bold;">else</span> {  </p><p><span style="color: rgb(153, 102, 51);"><font color="#000000">    </font>$protocol</span>  <span style="color: rgb(51, 51, 51);">=</span> <span style="background-color: rgb(255, 240, 240);">"http"</span>; </p><p> </p><p>} <span style="color: rgb(85, 119, 153);">?></span>  </p><p>
 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인