size=$size; } //Method for accept valid emails only function check($value) { //Delete Javascript tags and simple quotes. $value=Utils::form_text($value); $this->value=$value; $email_expression='([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)'; if(preg_match('/^'.$email_expression.'$/i', $value)) { return $value; } else { $this->std_error.='Email format error'; return ''; } } function get_type_sql() { return 'VARCHAR('.$this->size.') NOT NULL'; } /** * This function is used for show the value on a human format */ public function show_formatted($value) { return $value; } } ?>