Skip to content

Instantly share code, notes, and snippets.

@mcejp
Created September 14, 2023 12:51
  • Select an option

Select an option

Revisions

  1. mcejp created this gist Sep 14, 2023.
    97 changes: 97 additions & 0 deletions bsod.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,97 @@
    <!doctype html>

    <html>
    <head>
    <style>
    html {
    font-size: 1.2em;
    }

    body {
    background: #0000aa;
    color: #aaaaaa;
    font-family: courier, monospace;
    }

    h1 {
    display: inline-block;
    padding: 0em 1ch;
    margin: 0 auto;
    font-size: 1rem;
    font-weight: normal;
    background: #aaaaaa;
    color: #0000aa;
    }

    p {
    margin: 2em 0;
    text-align: left;
    }

    a, a:hover {
    color: inherit;
    font: inherit;
    }

    blink {
    color: yellow;
    -webkit-animation: blink 1s steps(1, end) infinite;
    animation: blink 1s steps(1, end) infinite;
    }

    @-webkit-keyframes blink {
    80% {
    opacity: 0;
    }
    }

    @keyframes blink {
    80% {
    opacity: 0;
    }
    }
    ul {
    list-style: none;
    }
    ul li::before {
    content: '*';
    position: absolute;
    left: 1em;
    }

    .preformatted {
    white-space: pre;
    }

    .bg-dkgray { background-color: #555555; }
    .c-white { color: #ffffff; }
    </style>
    </head>

    <body>
    <!-- From http://www.catswhocode.com/blog/how-to-create-a-bsod-like-404-page -->

    <h1>Application Error</h1>

    <p>Exception <span class="c-white"><?= htmlspecialchars(get_class($exception), ENT_QUOTES) ?></span> has occured. Message:</p>

    <p><span class="c-white preformatted"><?= htmlentities($exception->getMessage(), ENT_QUOTES) ?></span></p>
    <p>in <span class=""><?= $exception->getFile() . ':' . $exception->getLine() ?></span></p>

    <p>Stack trace:</p>
    <ul>
    <?php
    foreach (explode("\n", $exception->getTraceAsString()) as $line) {
    ?>
    <li><?= $line ?></li>
    <?php
    }
    ?>
    </ul>

    <p>
    Press any key to restart your computer <blink>_</blink>
    </p>

    </body>
    </html>