With the code indented and formatted a bit better, it's much easier to see where these problems are:
<?php
if (isset($_GET['success']) && empty ($_GET['success'])) {
echo'You\'ve been registered successfully! Please check your email to activate your account';
} else {
if(empty($_POST)=== false && empty($errors) === true) {
$register_data = array(
'username' =>$_POST['username]'],
'password' =>$_POST['password]'],
'first_name' =>$_POST['first_name'],
'last_name' =>$_POST['last_name]'],
'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);
}
}
?>