<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="http://localhost/project_php/style.css" />
<title>PHP Project</title>
</head>
<body id="target">
<header>
<h1>
<a href="http://localhost/project_php/index.php">JavaScript</a>
</h1>
</header>
<nav>
<ul>
<?php
echo file_get_contents("index.txt");
?>
</ul>
</nav>
<div>
<input type="button" value="white" onclick="document.getElementById('target').className='white'" />
<input type="button" value="black" onclick="document.getElementById('target').className='black'" />
</div>
<article>
<?php
if (empty($_GET['id']) == false) {
echo file_get_contents($_GET['id'] . ".txt");
}
?>
</article>
</body>
</html>
- css파일 제외 나머지는 txt파일로 만들었다.