Skip to content

Instantly share code, notes, and snippets.

View ichsanputr's full-sized avatar
🤚
Writing a cool code

Muhammad Ichsanul Fadhil ichsanputr

🤚
Writing a cool code
View GitHub Profile
<?php
function 인사($이름, $시간 = "낮") {
if ($시간 == "아침") {
return "좋은 아침이에요, $이름님!";
} elseif ($시간 == "저녁") {
return "안녕히 주무세요, $이름님!";
} else {
return "안녕하세요, $이름님!";
}
}
<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>
<?php
if ($_POST) {
$이름 = trim($_POST['name']);
$이메일 = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
$나이 = (int)$_POST['age'];
$성별 = $_POST['gender'] ?? '미지정';
// 유효성 검사
if (empty($이름)) {
echo "이름을 입력해주세요.";
<?php
// 방명록 데이터 읽기
$방명록파일 = "guestbook.txt";
$메시지들 = array();
if (file_exists($방명록파일)) {
$내용 = file_get_contents($방명록파일);
$메시지들 = json_decode($내용, true) ?: array();
}
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello, World!"
<?php
echo "Hello, World!";
?>
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');