Plugh\".
\n"; if (isset($_POST["text_in"])) { $text_in = stripslashes($_POST["text_in"]); if (($fd = @fopen("plugh.log", "a+"))) { fputs($fd, $_SERVER["REMOTE_ADDR"] . " " . $text_in . "\n"); fclose($fd); } $text_out .= "" . htmlspecialchars($text_in) . "
\n"; if ($text_in == "plugh") { $text_out .= "
There is a blinding flash of light (and a small puff of orange
\n"; $text_out .= "smoke), which clears to reveal a cryptic inscription on the wall
\n"; $text_out .= "reading \"" . $_SERVER["REMOTE_ADDR"] . "\"
\n"; #$text_out .= "reading \"" . preg_replace("^::ffff:([0-9.]+)", '\1', $_SERVER["REMOTE_ADDR"]) . "\"
\n"; } else if ($text_in == "xyzzy") { $text_out .= "
Yay! Someone who actually gets it! You get a cookie. Sorry this isn't an actual implementation of Colossal Cave, yet...
"; } else { if (preg_match("/^(?!::ffff:[0-9.]+$).*:.*/", $_SERVER["REMOTE_ADDR"])) $text_out .= "
Four times as much nothing happens.
\n"; else $text_out .= "
Nothing happens.
\n"; } } ?> <?xml version="1.0" encoding="UTF-8" ?> plugh.