I've posted a query for the past couple of evenings, but still not got anywhere.
Basically I am trying to validate information passed from a form, to do this I have created a error checking function (signup), which allows me to return any errors back to the same screen the form is contained on.
My problem comes when trying to the redirect the user once the form is completed succesfully. Basically I have had a number of header errors thrown out because of the use of includes. Someone did suggest using ob_start, and call back the header at the top of the page but I have found this does not work.
Anyone got any ideas?
?php
function callback(){
header("Location: [url]http://www.example.co.uk/confirm.php[/url]");
}
// Get Posted Variables
$process = $HTTP_POST_VARS['process'];
$name = $HTTP_POST_VARS['name'];
$dob1 = $HTTP_POST_VARS['dob1'];
$dob2 = $HTTP_POST_VARS['dob2'];
$dob3 = $HTTP_POST_VARS['dob3'];
$location = $HTTP_POST_VARS['location'];
$email = $HTTP_POST_VARS['email'];
$username = $HTTP_POST_VARS['username'];
$password1 = $HTTP_POST_VARS['password1'];
$password2 = $HTTP_POST_VARS['password2'];
// Include Files
include("includes/mail.php");
include("includes/functions.php");
$errors = Signup($process, $name, $dob1, $dob2, $dob3, $location, $email, $username, $password1, $password2);
?>
HTML & FORM HERE
<?php
if($errors == 3){
ob_start("callback");
}
?>