// also tried isset() and !is_null()...if (!preg_match("//",($_SESSION['sessiondate3']))) { $date3 = new DateTime($_SESSION['sessiondate2']); $date3 = strtotime($date3->format("Y-m-d")); $date4 = new DateTime($_SESSION['sessiondate3']); $date4 = strtotime($date4->format("Y-m-d")); if (($date4 - $date3) < (86400*14)) { // Here's one of the few times I'll use a static variable. // In UNIX time, 86400 is the number of seconds in a day. // 14 days in two weeks... you do the math :)$_SESSION['error'] = "Session 4 must be at least two weeks after Session 3.<br>Please change your dates accordingly."; session_write_close(); header("Location: expsessions.php?name=" . $_SESSION['lastpage']); die(); }}