Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('db_fns.php');
- require_once('user_auth_fns.php');
- $username = $_POST['username'];
- $password1 = $_POST['password1'];
- $password2 = $_POST['password2'];
- $email = $_POST['email'];
- session_start();
- try {
- if (!isset($_POST['$username']) ||
- !isset($_POST['$password1']) ||
- !isset($_POST['$password2']) ||
- !isset($_POST['$email'])
- ) {
- throw new Exception("You didn't completely fill out your register information.<br/>Please return to the previous page and fill out the form.");
- }
- register($username, $password1, $email);
- $_SESSION['valid_user'] = $username;
- new PageGenerator('Registration Succesful',
- '<h1>Congratulations!</h1>' .
- '<p>You have succesfully registered to the website, welcome ' . $_SESSION['valid_user']);
- }
- catch (Exception $e) {
- new PageGenerator('Error',
- '<h1>Error</h1>' .
- '<h2>The following error occured</h2>' .
- '<p>' .
- $e->getMessage() .
- '</p>');
- }
- ?>
Add Comment
Please, Sign In to add comment