Redirection in PHP

I have this code

if (is_null($_POST['name']) == TRUE) {
header("Location: http://www.martystudio.com/index.php?error=101&from=home");
}
print $name;

it works fine, but when iit is supposed to redirect it wont, i need to find out why and find the script that works:

Note, for some reason the link looks funny when im posting

[COLOR=silver][SIZE=1]Edited by h88 - fixed code[/SIZE][/COLOR]

Are you using GET or POST to post your variables?

The code is working fine…

you might be wanting to use output buffering too when redirecting.
ob_start()
ob_end_clean()
ob_end_flush()

that is so you wont be getting any errors about headers already sent