Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //configuration
- require("../includes/config.php");
- // if form was submitted
- if ($_SERVER["REQUEST_METHOD"] == "POST")
- {
- //TODO
- if (empty($_POST["username"]))
- {
- apologize("You must provide your username.");
- }
- else if (empty($_POST["password"]))
- {
- apologize("You must provide your password.");
- }
- else if ($_POST["password"] != $_POST["confirmation"])
- {
- apologize("Invalid username and/or password.");
- }
- else if (query("INSERT INTO users (username, hash, cash) VALUES(?, ?, 10000.00)", $POST["username"],crypt($_POST["password"]) === false )
- {
- render("register_form.php", ["title" => "Register"]);
- }
- }
- else
- {
- //else render form
- render("register_form.php", ["title" => "Register"]);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement