PHP automatically changes the background color based on the hexadecimal color code passed in

  • 2021-06-29 10:42:49
  • OfStack

 
<?php 
echo "<html>"; 
echo "<head><title> Change background color </title></head>"; 
if($_POST[inputColor]==""){ 
$inputColor="ffffff"; 
} 
echo "<body bgcolor=#{$_POST[inputColor]}>"; 
echo "<form action='33.php' method='post'>"; 
echo "<b> Please fill in html Color of </b>"; 
echo "<input type='text' name='inputColor' value={$_POST[inputColor]}>"; 
echo "<input type='submit' value=' Submit Background Color '>"; 
echo "</form>"; 
echo "</body>"; 
echo "</html>"; 

Related articles: