i'm having a little bit of a problem... i have a file with a bunch of functions in it for database manipulation. that all works fine, i wanted to make the error handling a bit better so i decided to redirect back to the originating page and pass an error message (via get) when an error is hit... here is an example :
function newclient($clientname,$password,$email,$address)
{
GLOBAL $db, $clienttable;
$clientname = trim($clientname);
$email = trim($email);
$address = trim($address);
$password = md5(trim($password));
$validEmail = valid_email($email);
if (!$validEmail)
{
header("Location: http://dspmedia.co.uk/clientAdmin/index.php?message=invalid%20email");
exit;
//return "newclienterror= bad email";
}
$query = @mysql_query("INSERT INTO dsp_clients (userName,userClientName,userPassword,userMail,userAddress) VALUES ('$email','$clientname','$password','$email','$address')");
if (!$query)
{
return "newclienterror=" . mysql_error();
} else {
return "user=ok";
}
}
?>
unfortuantely it is not redirecting, it's just a blank page. any ideas why its doing this? is there another way? please help. i'm desperate. many thanks