If you are using templates with numerous includes then exit() will end you script and your template will not complete (no </table>, , </html> etc...). Rather than having complex nested conditional logic within your content, just create a "footer.php" file that closes all of your HTML and if you want to exit out of a script just include() the footer before you exit(). for example: include ('header.php'); blah blah blah if (!$mysql_connect) { echo "unable to connect"; include ('footer.php'); exit; } blah blah blah include ('footer.php'); sinon comme je te disais plus haut fait tes controles autrement un peu de bidouillage et ça marche mieux... non ? exemple : <html> <head> <title>Page test.php</title> </head> Avant php <?php $exit='oui'; if($truc==machin) { $exit='non'; } elseif($bidule==test) { $exit='non'; } elseif($chose==ededed) { $exit='non'; } ... ... if($exit=='non') { //le script que tu veux faire } ?> Apres php </html>