Mezir is the IP address a field that the user has to fill in as well ? How is that value used afterwards ?
I'm not sure what's going on with your code above because it does not look like valid PHP (the $rules['address']
line can't go there)
If it's indeed a user-provided value and you have one or multiple possible values you want to allow, you could use the in:
validation rule.
If you simply want to store the current user IP, this should be done directly in the controller and has nothing to do with validators.