G'day.
I get this error when I go to some other page, or redirect to index.php
Warning: Cannot modify header information - headers already sent by (output started at /hermes/web05/blubbz/register.php on line 33
CODE on register.php:
<?php
if (isset($_POST['register_email'], $_POST['register_name'], $_POST['register_password'])) {
$register_email = $_POST['register_email'];
$register_name = $_POST['register_name'];
$register_password = $_POST['register_password'];
$errors = array();
if (empty($register_email) or empty ($register_name) or empty($register_password)) {
$errors[] = '<p style="background: #ff5e5e; border: 1px solid red; padding: 5px; font-size: 13px; color: #000;">
<img src="" alt="" style="margin-right: 10px;" /> All fields are required! </p>';
} else {
if (filter_var($register_email, FILTER_VALIDATE_EMAIL) === false) {
$errors[] = '<p style="background: #ff5e5e; border: 1px solid red; padding: 5px; font-size: 13px; color: #000;">
<img src="" alt="" style="margin-right: 10px;" /> The email address is not valid! </p>';
}
if (user_exists($register_email) === true) {
$errors[] = '<p style="background: #ff5e5e; border: 1px solid red; padding:5px; font-size: 13px; color: #000;">
<img src="" source" alt="" style="margin-right: 10px;" /> That email address is already registered! </p>';
}
}
if (!empty($errors)) {
foreach($errors as $error) {
echo $error, '<br />';
}
} else {
$register = user_register($register_email, $register_name, $register_password);
$_SESSION['user_id'] = $register;
header('Location: success.php');
exit();
}
}
?>`
On line 33:
header('Location: success.php');
Any help please? Any fix for this?
Thanks