Librebin

Source & Instances Upload
"; echo "
"; echo "\"captcha\""; echo ""; echo "
"; echo ""; } else { echo "
"; echo "
"; echo "Raw text"; } ?>
$i; $i++) $random_str .= $chars[random_int(0, count($chars)-1)]; return $random_str; } if (!isset($_REQUEST["content"])) die(); session_start(); $valid_upload = true; $content = htmlspecialchars(trim($_REQUEST["content"])); if (empty($_SESSION["captcha"]) || $_SESSION["captcha"] != strtoupper($_REQUEST["captcha"])) { if (!in_array($_REQUEST["api_key"], $api_keys)) { $valid_upload = false; echo "

Invalid captcha!

"; } } $content_len = strlen($content); if ($content_len > 1048576 || 15 > $content_len) { $valid_upload = false; echo "

Content must be between 15 and 1048576 chars!

"; } if ($valid_upload) { if (!file_exists("p")) mkdir("p"); $file_name = NULL; do { $file_name = random_string(); } while (file_exists("p/" . $file_name)); file_put_contents("p/" . $file_name, $content); header("Location: index.php?p=" . $file_name); } ?>