<?php if(!isset($_SESSION['username'])) { ?> <script type="text/javascript"> window.location = '<?php echo $site_url; ?>';</script> <?php } ?>