PHP根据传来的16进制颜色代码自动改变背景颜色
程序员文章站
2023-12-09 23:59:39
复制代码 代码如下: "; echo "改变背景颜色
<?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>";