-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcookie.php
More file actions
58 lines (56 loc) · 2.08 KB
/
cookie.php
File metadata and controls
58 lines (56 loc) · 2.08 KB
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
<?php
if(isset($_REQUEST["clear_data"])){
unset($_COOKIE["bg_color"]);
unset($_COOKIE["font_color"]);
$bg_color="white";
$font_color="black";
}
if(isset($_REQUEST["bg_color"])){
$_COOKIE["bg_color"]=$_REQUEST["bg_color"];
};
if(isset($_REQUEST["font_color"])){
$_COOKIE["font_color"]=$_REQUEST["font_color"];
};
if(isset($_COOKIE["bg_color"])){
$bg_color=$_COOKIE["bg_color"];
}
else{
$bg_color="white";
};
if(isset($_COOKIE["font_color"])){
$font_color=$_COOKIE["font_color"];
}
else{
$font_color="black";
}
?>
<body <?php print "bgcolor=\"$bg_color\" text=\"$font_color\"" ?>>
Âûáåðèòå öâåò ôîíà<br>
<form action="cookie_1.php" method="post">
<select name="bg_color">
<option value="red" <?php if($bg_color=="red"){print "selected";};?>> êðàñíûé</option>
<option value="white" <?php if($bg_color=="white"){print "selected";};?>> áåëûé</option>
<option value="green" <?php if($bg_color=="green"){print "selected";};?>> çåëåíûé</option>
<option value="yellow" <?php if($bg_color=="yellow"){print "selected";};?> > æåëòûé</option>
<option value="blue" <?php if($bg_color=="blue"){print "selected";};?>> ãîëóáîé</option>
<option value="black" <?php if($bg_color=="black"){print "selected";};?>> ÷åðíûé</option>
</select><br>
<br>
Âûáåðèòå öâåò øðèôòà<br>
<select name="font_color">
<option value="red" <?php if($font_color=="red"){print "selected";};?> > êðàñíûé</option>
<option value="white" <?php if($font_color=="white"){print "selected";};?>> áåëûé</option>
<option value="green" <?php if($font_color=="green"){print "selected";};?> > çåëåíûé</option>
<option value="yellow" <?php if($font_color=="yellow"){print "selected";};?>> æåëòûé</option>
<option value="blue" <?php if($font_color=="blue"){print "selected";};?>> ãîëóáîé</option>
<option value="black" <?php if($font_color=="black"){print "selected";};?>> ÷åðíûé</option>
</select>
<br>
<button type="submit" > Óñòàíîâèòü öâåòà </button>
</form>
<br>
<form action="cookie_1.php" method="post">
<input type="hidden" name="clear_data" size="40" maxlength="256">
<button type="submit" > Óäàëèòü öâåòà </button>
</form>
</body>