please fill in your desired username";
    if (strlen($name) > 32)
        $message .= "
username too long (32 character max)";
    if (!preg_match('/^[a-z][a-z0-9]{1,31}$/', $name))
        $message .= "username contains invalid characters (lowercase ascii only, must start with a letter)";
    if ($_REQUEST["sshkey"] == "" || mb_substr($_REQUEST["sshkey"], 0, 4) !== "ssh-")
        $message .= 'ssh key required: please create one and submit the public key. '
            . 'see our ssh wiki or '
            . 'hop on irc and ask for help';
    if ($_REQUEST["interest"] == "")
        $message .= "please explain why you're interested so we can make sure you're a real human being";
    if (posix_getpwnam($name) || forbidden_name($name))
        $message .= "sorry, the username $name is unavailable";
    // Check the e-mail address.
    $email = trim($_REQUEST["email"]);
    if ($email == "")
        $message .= "please fill in your email address";
    else {
        $result = SMTP::MakeValidEmailAddress($_REQUEST["email"]);
        if (!$result["success"])
            $message .= "invalid email address: " . htmlspecialchars($result["error"]) . "";
        elseif ($result["email"] != $email)
            $message .= "invalid email address. did you mean:  " . htmlspecialchars($result["email"]) . "";
    }
    // no validation errors
    if ($message == "") { 
	$sshkey = trim($_REQUEST["sshkey"]);
        $makeuser = "makeuser {$_REQUEST["username"]} {$_REQUEST["email"]} \"{$sshkey}\"";
        $msgbody = "
username: {$_REQUEST["username"]}
email: {$_REQUEST["email"]}
reason: {$_REQUEST["interest"]}
$makeuser
";
        if (mail('root', 'new tilde.club signup', $msgbody)) {
            echo '
                    email sent! we\'ll get back to you soon (usually within a day) with login instructions! be sure to check your spam folder as we\'ve had several reports of being marked as spam! 
back to tilde.club home
                  
                    something went wrong... please send an email to 
root@tilde.club with details of what happened
                  
            please correct the following errors: 
            =$message?>