示例#1
0
///////////////////////////////////////////////////////////////////////////////
// user submitted the "private pastebin" form? redirect them...
//
if ($_GET['goprivate']) {
    $sub = trim(strtolower($_GET['goprivate']));
    if (preg_match('/^[a-z0-9][a-z0-9\\.\\-]*[a-z0-9]$/i', $sub)) {
        header("Location: http://{$sub}." . TOPDOMAIN);
        exit;
    }
}
///////////////////////////////////////////////////////////////////////////////
// create our pastebin object
//
$pastebin = new Pastebin($CONF);
// clean up older posts
$pastebin->doGarbageCollection();
///////////////////////////////////////////////////////////////////////////////
// process new posting
//
$errors = array();
if (isset($_POST['paste'])) {
    session_start();
    if ($_POST['quux'] == $_SESSION['solution'] && strtolower($_POST['quux2']) == strtolower('blanc')) {
        //process posting and redirect
        $id = $pastebin->doPost($_POST);
        if ($id) {
            $pastebin->redirectToPost($id);
            exit;
        }
    }
    echo "[!?] Mauvais calcul ou erreur dans la devinette. Faites précédent, copiez votre texte et recollez-le dans un nouveau formulaire.";