Skip to content

Commit

Permalink
PHP 실습
Browse files Browse the repository at this point in the history
  • Loading branch information
egoing committed Apr 30, 2015
1 parent c7ed799 commit 1313d01
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 1.txt
@@ -0,0 +1,2 @@
<h2>JavaScript란?</h2>
JavaScript는 html을 제어합니다.
2 changes: 2 additions & 0 deletions 2.txt
@@ -0,0 +1,2 @@
<h2>변수와 상수</h2>
변수는 바뀌는 것 상수는 바뀌지 않은 것
2 changes: 2 additions & 0 deletions 3.txt
@@ -0,0 +1,2 @@
<h2>연산자</h2>
연산자는 계산하는 것입니다
31 changes: 31 additions & 0 deletions index.php
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="http://localhost/style.css">
</head>
<body id="target">
<header>
<img src="https://s3-ap-northeast-1.amazonaws.com/opentutorialsfile/course/94.png" alt="생활코딩">
<h1><a href="http://localhost/index.php">JavaScript</a></h1>
</header>
<nav>
<ol>
<?php
echo file_get_contents("list.txt");
?>
</ ol>
</nav>
<div id="control">
<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>
3 changes: 3 additions & 0 deletions list.txt
@@ -0,0 +1,3 @@
<li><a href="http://localhost/index.php?id=1">JavaScript란?</a></li>
<li><a href="http://localhost/index.php?id=2">변수와 상수</a></li>
<li><a href="http://localhost/index.php?id=3">연산자</a></li>
3 changes: 3 additions & 0 deletions php/1.php
@@ -0,0 +1,3 @@
<?php
echo $_GET['name'].",".$_GET['id'];
?>
10 changes: 10 additions & 0 deletions php/2.php
@@ -0,0 +1,10 @@
<html>
<head>
<title></title>
</head>
<body>
<?php
echo file_get_contents($_GET['id'].".txt");
?>
</body>
</html>

0 comments on commit 1313d01

Please sign in to comment.