started some input validation code and unit tests for it
[gwvp.git] / gwvplib / gwvpinputcheck.php
diff --git a/gwvplib/gwvpinputcheck.php b/gwvplib/gwvpinputcheck.php
new file mode 100644 (file)
index 0000000..59de285
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+// the purpose of this php is to provide input validation functions
+function gwvp_checkEmail($email)
+{
+       $match = preg_match("/^[a-zA-Z0-9\+]+@[a-zA-Z0-9\.]+$/", $email);
+       
+       if($match != 1) return false;
+       else return true;
+}
+
+?>
\ No newline at end of file