Hiho, need some help 
I just got this error, don’t know how to fix it… any help is appreciated.
Warning: Cannot modify header information - headers already sent by (output started at /home/virts/public_html/includes/overall/header.php:5) in /home/virtous/public_html/register.php on line 51
My code:
[php]<?php
include ‘core/init.php’;
include ‘includes/overall/header.php’;
if(empty($_POST) === false) {
$required_fields = array(‘username’, ‘password’, ‘password_again’, ‘email’, ‘email_again’);
foreach($_POST as $key=>$value) {
if(empty($value) && in_array($key, $required_fields) === true ) {
$errors[] = ‘Fields marked * are required.’;
break 1;
}
}
if(empty($errors) === true) {
if(user_exists($_POST['username']) === true) {
$errors[] = 'Sorry, the username \'' . $_POST['username'] . '\' is already in use.';
}
if(preg_match("/\\s/", $_POST['username']) == true) {
$errors[] = 'Username may not contain any spaces.';
}
if(strlen($_POST['password']) < 6) {
$errors[] = 'Password must be at least 6 characters.';
}
if($_POST['password'] !== $_POST['password_again']) {
$errors[] = 'Passwords don\'t match.';
}
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
$errors[] = 'A valid email address is required.';
}
if(email_exists($_POST['email']) === true){
$errors[] = 'Sorry, this email \'' . $_POST['email'] . '\' is already in use.';
}
}
}
print_r($errors);
?>
<div id="Main_Wrapper">
<?php
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']
);
register_user($register_data);
header('Location: register.php?success'); <----------------------------------------------Problem here
exit();
} else if (empty($errors) === false) {
echo output_errors($errors);
}
?>
Register
* are required fields
<br>
<div id="Registration_form">
<form action="" method="post">
<h3 class="register">* Username:</h3> <input type="text" class="input2" name="username"> <br>
<h3 class="register">* Password:</h3> <input type="password" class="input2" name="password"> <br>
<h3 class="register">* Confirm password:</h3> <input type="password" class="input2" name="password_again"><br>
<h3 class="register">* Email:</h3> <input type="text" class="input2" name="email"><br>
<h3 class="register">* Confirm email:</h3> <input type="text" class="input2" name="email_again"><br>
<h3 class="register">First name:</h3> <input type="text" class="input2" name="first_name"><br>
<h3 class="register">Last name:</h3> <input type="text" class="input2" name="last_name"><br>
<input type="submit" class="submit2" value="Register">
</form>
</div>
</div>
<?php
if (logged_in() === true){
include 'includes/widgets/loggedin.php';
} else {
include 'includes/widgets/login.php';
}
include 'includes/panel_right.php';
?>
</div>
<?php include 'includes/overall/footer.php'; ?>[/php]