PHP根据传来的16进制颜色代码自动改变背景颜色
(编辑:jimmy 日期: 2024/11/20 浏览:3 次 )
复制代码 代码如下:
<?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>";
<?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>";
下一篇:php smarty truncate UTF8乱码问题解决办法