I have a form on my site that I have included in a sidebar on the page. Basically what it does is collects some data, and if that data has been correctly filled in, it passes it on to a larger form on another page.
The problem is, I keep getting the 'headers already sent' error when it gets submitted. The weird thing is, the form works fine on my development server.
Basically my code looks like this;
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
// Checks for errors are here (omitted for brevity)
if(!$errors){
header('Location:'.bloginfo('url').'?page_id=xxx');
}
}
?>
Bearing in mind that I have to check for errors, is there another way that I can redirect to another page on the site without using header()?