Function name: CheckUser ($C _user)
Role: To determine whether a legitimate user name
Parameters: $C _user (user name to be detected)
Return Value: Boolean value
Note: none
The code is as follows |
Copy Code |
function CheckUser ($C _user) { if (! Checklengthbetween ($C _user, 4)) return false; Width test if (!ereg ("^[_a-za-z0-9]*$", $C _user)) return false; Special character test return true; } |
Function name: Checkpassword ($C _passwd)
Role: Determine if the password is a legitimate user
Parameters: $C _passwd (password to be detected)
Return Value: Boolean value
Note: none
/
The code is as follows |
Copy Code |
function Checkpassword ($C _passwd) { if (! Checklengthbetween ($C _passwd, 4)) return false; Width detection if (!ereg ("^[_a-za-z0-9]*$", $C _passwd)) return false; Special character detection return true; } |
Function name: Checktelephone ($C _telephone)
Role: To determine whether a legal telephone number
Parameters: $C _telephone (phone number to be detected)
Return Value: Boolean value
Note: none
//-----------------------------------------------------------------------------------
code is as follows |
copy code |
function Checktelephone ($C _telephone) { If!ereg ("^[+]?[ 0-9]+ ([xx-][0-9]+) *$ ", $C _telephone)) return false; return true; } |