상세 컨텐츠

본문 제목

[PHP] 5.2 버전 이하 암호하

php

by 2hansoul 2021. 9. 8. 19:05

본문

반응형

password.php
0.01MB

5.2 이하 버전에서는 include 하여 암호화를 진행할수있다 

<!doctype html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <title>PHP</title>
    <style>
      body { 
        font-family: Consolas, monospace;
      }
    </style>
  </head>
  <body>
    <h1>password_hash</h1>
    <?php
  include "./password.php";
      $password = 'adda1111';
      $encrypted_password = password_hash( $password, PASSWORD_DEFAULT);
      echo '<p>password : ' . $password . '<br />encrypted_password ' . $encrypted_password . '</p>';
    ?>
  </body>
</html>

include 설정을 하고 hash 돌려야 낮은 버전에서 돌아 간다 

include 파일 같은 경우는 같은 디렉토리 안에서 돌려야지 먹히기 때문에 같이 넣어서 돌리고

다른 곳에서 쓰려면 절대 경로 설정을 해주면 된다

반응형

관련글 더보기

댓글 영역