Creating GIT Repo
This commit is contained in:
34
darkmode.php
Normal file
34
darkmode.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// Diese PHP-Seite setzt ein Cookie, das einen Darkmode aktiviert oder deaktiviert.
|
||||
|
||||
if(isset($_COOKIE['darkmode'])) {
|
||||
$darkmode = $_COOKIE['darkmode'];
|
||||
} else {
|
||||
$darkmode = 'Off';
|
||||
}
|
||||
|
||||
if(isset($_GET['darkmode']) && $_GET['darkmode'] == "Einschalten") {
|
||||
setcookie('darkmode', 'On', time() + 20 * 365 * 24 * 60 * 60);
|
||||
$darkmode = 'On';
|
||||
} elseif(isset($_GET['darkmode']) && $_GET['darkmode'] == "Ausschalten") {
|
||||
setcookie('darkmode', 'Off', 1);
|
||||
$darkmode = 'Off';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<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>PHP Vatsim Scheduler: Darkmode</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>PHP Vatsim Scheduler: Darkmode</h1>
|
||||
<div>Darkmode ist <b><?php echo $darkmode == "On" ? "eingeschaltet" : "ausgeschaltet" ?></b></div>
|
||||
<form action="" method="GET">
|
||||
<input type="submit" name="darkmode" value="Einschalten">
|
||||
<input type="submit" name="darkmode" value="Ausschalten">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user