".$_SESSION['ERROR']['MSG'].""; $_SESSION['ERROR']['MSG'] = NULL; $_SESSION['ERROR']['TYPE'] = NULL; return $msg; } } function isUserSignedIn() { if(!$_SESSION["USER"]) { $_SESSION['ERROR']['MSG'] = "You must log in to view this page."; $_SESSION['ERROR']['TYPE'] = "error"; header("Location:login.php"); } } function isGet($param) { if($_GET[$param]=="") { header("Location:".$_SERVER['HTTP_REFERER']); } } function array_push_assoc($array, $key, $value){ $array[$key] = $value; return $array; } // Form validation functions // This function verifies that a textbox is not blank. If it is, it returns an error message. function isNotBlank($field){ if ($field != "") return true; else return false; } // This function verifies that the phone field is a 10-digit number (no dashes or parentheses). function isPhone($field){ if ((strlen($field)==10) && (is_numeric($field))) return true; else return false; } // This function verifies that a given date range is valid. function isValidRange($from_date, $to_date){ if ($from_date < $to_date) return true; else return false; } // This function verifies that $cvc is a three-digit number. function isZip($zip) { if ((strlen($zip)==5) && (is_numeric($zip))) return true; else return false; } // This function verifies that $cardno is a valid credit card number. function isCreditCard($cardno) { if ((strlen($cardno)>10) && (is_numeric($cardno))) return true; else return false; } // This function verifies that $file is a valid resume file format (MS Word, rtf, or pdf. function isResume($type,$size) { if ((($type == "application/rtf") || ($type == "application/pdf") || ($type == "text/plain")) && ($size < 1000000)) return true; else return false; } // This function verifies that $cvc is a three-digit number. function isCVV($cvv) { if ((strlen($cvv)==3) && (is_numeric($cvv))) return true; else return false; } // This function verifies that the email field contains an @ and .* at the end of the string. function isEmail($field){ if ((strpos($field, "@")) && (strpos($field, "."))) return true; else return false; } // This function verifies that field1 and field2 match function isMatch($field1, $field2){ if ($field1 == $field2) return true; else return false; } // This function verifies that field1 is of a given length function isLength($field1, $length){ if (strlen($field1) >= $length) return true; else return false; } function isEmpty($array) { $empty = 0; for ($i=0;$i" . $label . ""; } else { return ""; } } } ?> Leonard Sloan | Log In

Log In