PHP根据传来的16进制颜色代码自动改变背景颜色

代码如下:

<?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>";