query('SELECT * FROM users'); while ($line = $DatabaseQuery->fetchArray()) { if ($storeIP || $storeIP == "true") { if ($line['ip'] == $ip) { $ipAddresses++; } } if ($line['username'] == "$Username" && $Username != "" && $line['username'] != "") { header("Location: register.php?e=exists"); die(); } } if ($storeIP || $storeIP == "true") { if ($ipAddresses > $maxAccountsPerIP) { header("Location: register.php?e=limit"); die(); } } $Key = hash('sha256', rand()); $Database->exec("INSERT INTO users(username, password, usertype, primaryadmin, numberofcomments, lastused, created, ip, useragent, key) VALUES('$Username', '$Password', '1', '0', '0', '$lastUsed', '$Created', '$ip', '$userAgent', '$Key')"); header("Location: login.php"); die(); } else { $html = ""; $html = printHeader($html, 0); $html .= "\t\t\t

Welcome to $instanceName

\n"; $html .= "\t\t\t\t

To create an account, enter your desired user name and password.

\n"; $html .= "\t\t\t\t
\n"; $html .= "\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\n"; if (isset($Redirect)) $html .= "\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\n"; $html .= "\t\t\t\t
\n"; if (isset($_REQUEST['e']) && htmlspecialchars($_REQUEST['e']) == "exists") { session_unset(); session_destroy(); $html .= "\t\t\t\t

An account by this name already exists.

\n"; } else if (isset($_REQUEST['e']) && htmlspecialchars($_REQUEST['e']) == "mismatch") { session_unset(); session_destroy(); $html .= "\t\t\t\t

The two passwords do not match.

\n"; } else if (isset($_REQUEST['e']) && htmlspecialchars($_REQUEST['e']) == "limit") { session_unset(); session_destroy(); $html .= "\t\t\t\t

Calm down. You've created too many accounts.

\n"; } $html = printFooter($html); print "$html"; } ?>