커뮤니티

고용노동부, 산업인력공단과 함께하는 강원도 유일한 기업중심 IT전문교육기관 ICT융합캠퍼스만의 특별한교육입니다.
공인 IT숙련기술인의 다양한 접근방법으로 전문가다운 실무교육을 받을 수 있습니다.

Category

교육강좌

WEB 웹 애플리케이션 만들기 - PHP 실습

페이지 정보

작성자 관리자 댓글 0건 조회 2,905회 작성일 20-06-08 11:48

본문

PHP 실습

PHP 실습 1

PHP 실습2

1.php

1
2
3
<?php
echo $_GET['name'].",".$_GET['id'];
?>

2.php

1
2
3
4
5
6
7
8
9
10
<html>
<head>
<title></title>
</head>
<body>
<?php
echo file_get_contents($_GET['id'].".txt");
?>
</body>
</html>

PHP 실습3

PHP 실습 4

index.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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>
<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>

list.txt

1
2
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>

1.txt

1
2
<h2>JavaScript란?</h2>
JavaScript는 html을 제어합니다.

2.txt

1
2
<h2>변수와 상수</h2>
변수는 바뀌는 것 상수는 바뀌지 않은 것

3.txt

1
2
<h2>연산자</h2>
연산자는 계산하는 것입니다

소스코드

github

Sound of coding

전체 뮤직 비디오 

쉬어가는 코스 

끝이 열려 있는 공부

  • 트위터로 보내기
  • 페이스북으로 보내기
  • 구글플러스로 보내기

답변목록

등록된 답변이 없습니다.