文字サイズ・背景色選択
<html> <head> <title>文字サイズ・背景色選択</title> </head> <?php if($_POST["size"] and $_POST["color"]) { echo '<body style="font-size:', $_POST["size"], 'px;background:', $_POST["color"], '">'; } else { echo '<body style="font-size:17px" >'; } ?> <form action="" method="POST"> 文字の大きさを選択してください。<br> <input type="radio" name="size" value="22">大<br> <input type="radio" name="size" value="17" checked>中<br> <input type="radio" name="size" value="12">小<br> <br> 背景色を選択してください。<br> <input type="radio" name="color" value="ffcccc" checked>赤<br> <input type="radio" name="color" value="ccffcc">緑<br> <input type="radio" name="color" value="ccccff">青<br> <br> <input type="submit" value="送信"><br> <br> </form> </body> </html>
〔 実行する 〕