This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function 인사($이름, $시간 = "낮") { | |
| if ($시간 == "아침") { | |
| return "좋은 아침이에요, $이름님!"; | |
| } elseif ($시간 == "저녁") { | |
| return "안녕히 주무세요, $이름님!"; | |
| } else { | |
| return "안녕하세요, $이름님!"; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form method="POST" action="process.php"> | |
| 이름: <input type="text" name="name" required><br> | |
| 이메일: <input type="email" name="email" required><br> | |
| 나이: <input type="number" name="age" min="1" max="120"><br> | |
| 성별: | |
| <input type="radio" name="gender" value="남성"> 남성 | |
| <input type="radio" name="gender" value="여성"> 여성<br> | |
| <button type="submit">회원가입</button> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ($_POST) { | |
| $이름 = trim($_POST['name']); | |
| $이메일 = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL); | |
| $나이 = (int)$_POST['age']; | |
| $성별 = $_POST['gender'] ?? '미지정'; | |
| // 유효성 검사 | |
| if (empty($이름)) { | |
| echo "이름을 입력해주세요."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // 방명록 데이터 읽기 | |
| $방명록파일 = "guestbook.txt"; | |
| $메시지들 = array(); | |
| if (file_exists($방명록파일)) { | |
| $내용 = file_get_contents($방명록파일); | |
| $메시지들 = json_decode($내용, true) ?: array(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def hello(): | |
| return "Hello, World!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| echo "Hello, World!"; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const os = require('os'); | |
| const app = express(); | |
| const PORT = 4000; | |
| // Target log directory (in home dir) | |
| const logDir = path.join(os.homedir(), 'irandra-api', 'log'); |
OlderNewer