Forum Moderators: coopster
All redirect info in php I have been able to find says it must be in the head, before anything else. I was thinking it would be better in my situation to do something like (if possible)
if ($x="" ){
redirect http:www.example.com;}
Now i'm sure its not as simple as that, but is there something like that I can use?
Can anyone point me in the right direction, or help me out with this? Thanks alot
if($x == ""){
header("Location: some_page.php");
}
-sned
something like this:
if([url=http://us2.php.net/manual/en/function.empty.php]empty[/url]($_POST['field'])) {
[url=http://us2.php.net/manual/en/function.header.php]header[/url]("Location: form.html");
[url=http://us2.php.net/manual/en/function.exit.php]exit[/url]();
}
good luck!
<?php
if(empty($_POST['email'])) {
echo "field is empty";
//header("Location: http://www.example.com");
exit();
}
?>
to test the if condition. It might be an empty [us2.php.net] vs isset [us2.php.net] thing.