"HTML 라디오 버튼"의 두 판 사이의 차이

3번째 줄: 3번째 줄:
;HTML RADIO 버튼
;HTML RADIO 버튼


==radio_button.php==
==PHP==
===radio_button.php===
<source lang='html5'>
<source lang='html5'>
<!DOCTYPE html>
<!DOCTYPE html>
19번째 줄: 20번째 줄:
</source>
</source>


==radio_button_ok.php==
===radio_button_ok.php===
<source lang='php'>
<source lang='php'>
<?php
<?php
28번째 줄: 29번째 줄:
</source>
</source>


==예제==
===예제===
*http://jmnote.com/php/radio_button.php
*http://jmnote.com/php/radio_button.php



2012년 6월 21일 (목) 11:12 판

HTML RADIO button
HTML 라디오 버튼
HTML RADIO 버튼

1 PHP

1.1 radio_button.php

<!DOCTYPE html>
<meta charset="utf-8" />
<title>라디오 버튼</title>
<form method='post' action='radio_button_ok.php'>
<input TYPE='radio' id='r1' name='fruit' value='apple' />
<label for='r1'>사과</label>
<input TYPE='radio' id='r2' name='fruit' value='banana' />
<label for='r2'>바나나</label>
<input TYPE='radio' id='r3' name='fruit' value='lemon' checked='checked' />
<label for='r3'>레몬</label>
<input type='submit' value='제출' />
</form>

1.2 radio_button_ok.php

<?php
echo '<xmp>';
print_r($_POST);
echo '</xmp>';
?>

1.3 예제

  • 바나나를 선택하고 [제출] 누른 경우
Array
(
    [fruit] => banana
)

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}