250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 애니메이션
- ipad
- 백엔드
- 자바스크립트
- php
- 비전공 개발자
- effect
- javascript
- IOS
- HTML
- xcode
- jQuery
- SWIFT
- hover
- 프론트엔드
- button
- react
- html5
- CSS
- MAC
- Animation
- 비전공자
- iPhone
- css3
- keyframes
- iOS 개발자
- front-end
- image
- 풀스택
- 개발자
Archives
- Today
- Total
비전공자 개발일기
PHP with Select Option 본문
728x90
SMALL
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WEB</title>
</head>
<style>
* {
text-align: center;
}
</style>
<body>
<h1>Select with PHP</h1>
<?php
$php = "php";
$num = 100;
?>
언어 선택
<select name="stack" id="stack">
<option value="">선택</option>
<option value="html" <?=($php == "html")? "selected" : " "?>>HTML</option>
<option value="php" <?=($php == "php")? "selected" : " "?>>PHP</option>
<option value="iOS" <?=($php =="iOS")? "selected" : " "?>>iOS</option>
<option value="android" <?=($php == "android")? "selected" : " "?>>Android</option>
</select>
숫자 선택
<select name="number" id="number">
<option value="">선택</option>
<option value="100" <?=($num == 100)? "selected" : " "?>>100</option>
<option value="200" <?=($num == 200)? "selected" : " "?>>200</option>
<option value="300" <?=($num == 300)? "selected" : " "?>>300</option>
<option value="400" <?=($num == 400)? "selected" : " "?>>400</option>
<option value="500" <?=($num == 500)? "selected" : " "?>>500</option>
</select>
</body>
</html>
728x90
LIST
'PHP' 카테고리의 다른 글
SWITCH CASE with PHP (0) | 2022.01.01 |
---|---|
PHP with if condition (0) | 2021.12.31 |
PHP & jQuery checkbox 활용 (0) | 2021.12.29 |
PHP 5일차 (0) | 2021.12.25 |
PHP 4일차 (배열 출력) (0) | 2021.12.23 |