You could check out this thread,
Link and try the following code.
Code:
$script = $xcart_catalogs['partner']."/home.php?mode=profile_created";
}
if (empty($av_error)) {
if( $reg_error ) {
func_header_location($script);
}
else {
header("LOCATION: pages.php?pageid=2");
}
}