復制代碼 代碼如下:
<?php
echo "<html>";
echo "<head><title>改變背景顏色</title></head>";
if($_POST[inputColor]==""){
$inputColor="ffffff";
}
echo "<body bgcolor=#{$_POST[inputColor]}>";
echo "<form action='33.php' method='post'>";
echo "<b>請填寫html的顏色</b>";
echo "<input type='text' name='inputColor' value={$_POST[inputColor]}>";
echo "<input type='submit' value='提交背景顏色'>";
echo "</form>";
echo "</body>";
echo "</html>";