1<form action="" method="post">
2
3<select name="Color">
4 <option value="White">White</option>
5 <option value="Red">Red</option>
6 <option value="Green">Green</option>
7 <option value="Blue">Blue</option>
8 <option value="Pink">Pink</option>
9 <option value="Yellow">Yellow</option>
10</select>
11
12<input type="submit" name="submit" value="Get Selected Values" />
13
14</form>
15<?php
16
17if(isset($_POST['submit'])){
18
19 $selected_val = $_POST['Color']; // Storing Selected Value In Variable
20 echo "<style>body{background-color:".$selected_val.";}</style>"; // Displaying Selected Value
21
22}
23
24?>