はじめに
phpでフォームのセレクト要素を受け取る方法。
けっこう基本だと思うけど忘れがち。
html
html側でセレクト部分だけ抜粋すると
<select name="frameRate" id="frameRate">
<?php
for($i=1;$i<10;$i++){
print('<option value="' .$i. '">'.$i.'</option>');
}
?>
</select>
php
次にphpのセレクト部分の値の受取だけ抜粋。
$_POST['htmlで指定したname']で値を取得。
$frameRate = $_POST['frameRate'];
