我用的是form表单属性style颜色赋值, 把text文本框颜色值付给style。
代码如下:
<body >
<?php $color=ffffff?>
<?php
if($_POST[sub]){
$color=$_POST[text];
}
?>
<form name="form" method="post" action="" enctype="" style="background:#<?php echo $color;?>">
<table align="center" width="500" height="500" cellpadding="2" cellspacing="0" >
<tr>
<td align="center" width="500" height="450" bgcolor="" >
<input name="text" type="text" size="20" />
<input name="sub" type="submit" value="提取" />
</td>
</tr>
</table>
</form>
</body>