<?$name=$_POST["thename"];
$age=$_POST["theage"];
$comments=$_POST["thecomments"];

if($name=="" && $age=="")//both blank
{
header("location:enterdetails.php?error=1&error2=1");
}
else if($name=="")//name blank
{
header("location:enterdetails.php?error=1");
}
else//age blank
{
header("location:enterdetails.php?error2=1&name=$name");
}

?>