$this->BHBFilterChain()
<?php // dir \dir \file; namespace user\filter\user; // dir\dir \file \BHB::$load->f('ext\filter\filter'); // dir\dir \file \class as AliasName; use ext\filter\filter\filter as BHBfilter; class myFiltersDeeperThanBHB extends BHBfilter { //****************************************** public function MY_int($in) { if(!is_numeric($in)) { $a = "MY_Integer"; }else{ $inInt = (int) $in; if($inInt != $in){ $a = "MY_Integer"; } } return $a; } //************************************************************************ public function MY_unique($in,$opt) { //User. if($opt == "user") { $res=\BHB::$db->query( \BHB::$db->db("",$opt), $sql = "SELECT id FROM bhb_user WHERE login = '".mysql_real_escape_string($in)."' " ); if($res["id"]) $a = "Login <b>".$in."</b> is in <b>Use</b> by an other user!"; } //Admin. if($opt == "admin") { } return $a; } } //******************************************* class user extends myFiltersDeeperThanBHB { //************************************ public function signup_or_modify() { $this->BHBFilterChain("nmulg", "nmulg", "nmulg_secureError", "secure"); $this->BHBFilterChain("nmulg", "nmulg_captcha", "nmulg_captchaError", array("captcha", "required")); //dbAlias declared in config/configdb.php if(!\BHB::$login->isLogin("user")){ $this->BHBFilterChain("nmulg", "nmulg_login", "nmulg_loginError", array("required", "MY_unique"=>"user", "minlength"=>"2", "maxlength"=>"15")); $this->BHBFilterChain("nmulg", "nmulg_password", "nmulg_passwordError", array("required", "minlength"=>"2", "maxlength"=>"15")); $this->BHBFilterChain("nmulg", "nmulg_password_confirm", "nmulg_password_confirmError", array("required", "equalTo"=>"nmulg_password", "minlength"=>"2", "maxlength"=>"15")); } $this->BHBFilterChain("nmulg", "nmulg_ns", "nmulg_nsError", array("required", "minlength"=>"2")); $this->BHBFilterChain("nmulg", "nmulg_confirm", "nmulg_confirmError", array("required")); //checkbox_NON_ARRAY can has only required $this->BHBFilterChain("nmulg", "nmulg_animal", "nmulg_animalError", array("required", "minlength"=>"1", "maxlength"=>"3")); $this->BHBFilterChain("nmulg", "nmulg_tfuel", "nmulg_tfuelError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_oddnumbers", "nmulg_oddnumbersError", array("required", "minlength"=>"3", "maxlength"=>"4")); //$this->BHBFilterChain("nmulg", "nmulg_ybirth", "nmulg_ybirthError", array("required", "preg_match"=>array("/^[\d]{4,4}$/", "Only 4 Integer Values!"))); $this->BHBFilterChain("nmulg", "nmulg_ybirth", "nmulg_ybirthError", array("required", "minlength"=>"10", "maxlength"=>"10")); $this->BHBFilterChain("nmulg", "nmulg_resident", "nmulg_residentError", array("required", "minlength"=>"2")); $this->BHBFilterChain("nmulg", "nmulg_resident_state", "nmulg_resident_stateError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_gender", "nmulg_genderError", array("required")); //radio can has only required $this->BHBFilterChain("nmulg", "nmulg_email", "nmulg_emailError", array("email","required")); $this->BHBFilterChain("nmulg", "nmulg_names", "nmulg_namesError", array("requiredIA", "requiredIAmin"=>"2", "requiredIAmax"=>"3", "requiredIAEFmin"=>"2", "requiredIAEFmax"=>"4", "inputIA_preg_match"=>array("/^[a-zA-Z]{2,4}$/", "Only from 2 to 4 Alphabetic Chars.")) ); //, "requiredIAEFmax"=>"3")); //requiredIA => means requiredInputArray ///requiredIA => almost a charcter in almost a field //requiredIAmin => almost one char in min nr. field. //requiredIAmax => almost one char in max nr. field. //requiredIAEFmin => min chars in every field. /* //requiredIAEFmax => max chars in every field. $this->BHBFilterChain("nmulg", "nmulg_one", "nmulg_oneError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_two", "nmulg_twoError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_three", "nmulg_threeError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_four", "nmulg_fourError", array("required")); */ $this->BHBFilterChain("nmulg", "nmulg_aboutme", "nmulg_aboutmeError", array("strip_tags"=>"<div><img>", "htmlentities", "required")); // "htmlentities", //htmlentities($_REQUEST[$strPostVar], ENT_QUOTES, "UTF-8"); $this->BHBFilterChain("nmulg", "nmulg_one", "nmulg_oneError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_two", "nmulg_twoError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_three", "nmulg_threeError", array("required")); $this->BHBFilterChain("nmulg", "nmulg_four", "nmulg_fourError", array("required")); //$this->errorsAjaxOfAnInputArray is an array that contains the errors mesages of the filter for //a sigle input iddentified after jQ. blur(). You may use the simple BHBsoft kit for jQuery.Ajax, or create a new by tour self. $this->BHBAjaxResponse("GET"); //POST or GET should be the same with //\BHB::$qform->closeAndShowErrorAfterPostAndJQAjax("idbhbform","POST",array(...)) } }