When I use localhost, after completing my registration form, for some reason it won't redirect to the "success" page, and nothing is added to the database. The same outcome occurred when I uploaded the files to a legitimate web server, however, the database did update with the new user.
I've been studying these PHP tutorials by Alex from the pop academy step-by-step from here: http://www.youtube.com/watch?v=5A50qmC7wFo
Here is the PHP code:
<?php 
                if (isset($_GET['success'])  === true && empty ($_GET['success'])  === false){
                    echo '<h8>You\'ve been registered successfully.<br>Please check your email for a confirmation link.</h8>';
                    header("refresh:20;url=index.php");
                } else{
                    include 'regform.php'; //REGISTRATION FORM
                    if (empty($_POST) === false && empty($errors) === true){
                        $register_data = array(
                        'first_name'    => $_POST['first_name'], 
                        'last_name'     => $_POST['last_name'], 
                        'username'      => $_POST['username'], 
                        'password'      => $_POST['password'],                          
                        'email'         => $_POST['email'],
                        'email_code'    => md5($_POST['username'] + microtime())
                        );
                        register_user($register_data);
                        header('Location: register.php?success');
                        exit();
                    } else if (empty($errors) === false){
                        echo output_errors($errors);
                    }
                }
            ?>  
Can someone please help me with this?