Welcome Guest, Not a member yet? Register   Sign In
What's the best place for storing reserved usernames in CodeIgniter?
#1

(This post was last modified: 06-09-2023, 10:40 PM by InsiteFX. Edit Reason: Fixed html code do not post html code in the post! )

I'm developing a website and want to implement a feature that prevents users from creating accounts with certain reserved usernames like "account," "index," "profile," and others. I have already compiled a list of these reserved usernames, but I'm unsure about the best place to store this data/array within CodeIgniter.
As someone who is familiar with CodeIgniter, I prefer to adhere to its recommended structure and organization. However, I'm uncertain whether storing an array of reserved usernames in helpers, libraries, or configs is the appropriate approach. I don't want to deviate from best practices.
I would greatly appreciate any suggestions on where to store this array within the CodeIgniter framework. Thank you in advance for your assistance!
Reply
#2

Save the names to the database, load them into an array then check to see if the name is in the array.

This way you can always add more names and keep it up to date.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB