-
Notifications
You must be signed in to change notification settings - Fork 0
/
bg-colour.php
84 lines (69 loc) · 2.86 KB
/
bg-colour.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bg color</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<style>
.container {
max-width: 300px;
background-color: white;
border-radius: 5%;
padding: 20px;
margin-top: 30px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.hed {
font-size: 1.4rem;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
margin-bottom: 10px;
text-align: center;
font-weight: 400;
}
</style>
</head>
<body>
<div class="container">
<form action="bgcolor.php" method="post" class="row g-3">
<div class="col-md-12 col-sm-12">
<div class="hed">Select Background Color</div>
<hr>
<div class="form-check">
<input type="radio" name="color" value="red" id="red" class="form-check-input">
<label for="red" class="form-check-label" >Red Color</label>
</div>
<div class="form-check">
<input type="radio" name="color" value="yellow" id="yellow" class="form-check-input">
<label for="yellow" class="form-check-label" >Yellow Color</label>
</div>
<div class="form-check">
<input type="radio" name="color" value="green" id="green" class="form-check-input">
<label for="green" class="form-check-label" >Green Color</label>
</div>
<div class="form-check">
<input type="radio" name="color" value="blue" id="blue" class="form-check-input">
<label for="blue" class="form-check-label" >Blue Color</label>
</div>
</div>
<input type="submit" name="submit" value="Change Baground Color" class="btn btn-primary">
</form>
</div>
<?php
if (isset($_POST["submit"])) {
if (isset($_POST["color"])) {
$color = $_POST["color"];
echo "<style>
body{
background-color: $color;
}
</style>";
} else {
echo "please select a coloe";
}
}
?>
</body>
</html>