prova così, ciao:
Codice PHP:
if ($xxxxxxx)

{

header("location:  miapagina.htm"); 

}

else

{

$XX
}

//visto che sono tra i tag php come posso dare un comando per far aprire una pagina????