How to change the Background Color in PHP

Now you can easily change the background color of your website or blog through PHP. Through PHP Language you can change dynamically.


<title>Dynamic Background Color Change</title>

<body bgcolor="<?php
if (isset($_POST['btn']))
echo $p=$col;
echo $p="#ffffff";

<form action="" method="post" >
<strong> Choose Color to Change Background :- </strong>
<select name="t1">
<option value="">Choose Color </option>
<option value="#000000"> Black </option>
<option value="#0000ff"> Blue </option>
<option value="#a52a2a"> Brown </option>
<option value="#00ffff"> Cyan </option>
<option value="#006400"> Dark Green </option>
<option value="#808080"> Grey </option>
<option value="#008000"> Green </option>
<option value="#ffa500"> Orange </option>
<option value="#ffc0cb"> Pink </option>
<option value="#800080"> Purple </option>
<option value="#ff0000"> Red </option>
<option value="#ffffff"> White </option>
<option value="#ffff00"> Yellow </option>
<input type="submit" name="btn" value="Submit">


Leave a Reply

Notify of