Remove trailing ?>
[xhtml-compiler.git] / purgatory.php
blob8e46057431429b161c7067a65af5a35bc3844881
1 <?php
3 $cookie = 'purgatory';
4 $mode = isset($_COOKIE[$cookie]) ? (bool) $_COOKIE[$cookie] : false;
6 // purgatory mode lasts half a year
7 if (isset($_POST['purgatory'])) {
8 $mode = !$mode;
9 setcookie($cookie, $mode ? '1' : '0',
10 time() + 60 * 60 * 24 * 7 * 21, '/'
14 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
15 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
16 <head>
17 <title>Purgatory-mode - XHTML Compiler</title>
18 <style type="text/css">
19 form {text-align: center;}
20 fieldset {border: 0;}
21 </style>
22 </head>
23 <body>
24 <h1>Purgatory-mode</h1>
25 <p>Purgatory-mode is a special cookie that causes all requests to
26 redirect to <code>main.php</code>. As such, it's good for page
27 developers who want to see their changes in real-time without
28 having to manually append <code>?purge=1</code> to their page name.</p>
29 <p>Note that purgatory-mode will still check if the source file
30 is newer than the cache file. To override completely, you must use
31 the purge parameter.</p>
32 <form method="post" action="">
33 <fieldset>
34 <p>Purgatory mode is: <strong style="color:<?php echo $mode ? '#F00' : '#090' ?>"><?php echo $mode ? 'On' : 'Off' ?></strong></p>
35 <input name="purgatory" type="submit" value="Toggle purgatory-mode" />
36 </fieldset>
37 </form>
38 </body>
39 </html>