if (!$_GET[gal]) { Header("Location: photogallery.html"); exit; } if (!File_Exists("photogallery/".$_GET[gal])) { Header("Location: photogallery.html"); exit; } ?>