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 파일 같은 경우는 같은 디렉토리 안에서 돌려야지 먹히기 때문에 같이 넣어서 돌리고
다른 곳에서 쓰려면 절대 경로 설정을 해주면 된다
| 암호화 단방향 복호화 해싱 (0) | 2021.09.10 |
|---|---|
| PHP Warning: date(): It is not safe to rely on the system's timezone settings 타임존 에러 (0) | 2021.09.09 |
| [PHP] 암호화 (0) | 2021.09.07 |
| 해시(hash) 솔트(salt) 암호화 기법 (0) | 2021.09.06 |
| [PHP] location.href vs location.replace (0) | 2021.08.25 |
댓글 영역