Ayoub M.
Ayoub M.

Reputation: 4808

simple way to store parameters in php cms

I am working on a cms and there are some simple parameters like number of posts per page, default color and style sheet, that are customizable by the user trough an UI. So what is the best way to store this settings in simple and secure way? Help is very appreciated.

Upvotes: 0

Views: 152

Answers (2)

David Thomas
David Thomas

Reputation: 253396

Keep the options in a database or cookie, since they're user specific. You could also have several short configuration files and include the relevant ones on request.

For colour-schemes, I'd recommend using short css files detailing the colours used by each of the possible themes (each theme in its own stylesheet, fetched on request depending upon which theme the user has stored against his/her profile).

For number of posts per page...I think a cookie on the client's machine is sufficiently secure for your purposes. Failing that, store in a session, maybe? Or, again, in the database against the user's profile.

Upvotes: 2

conmulligan
conmulligan

Reputation: 7148

Store it in a database, if you're using PHP you should have access to either MySQL or SQLite.

Upvotes: 0

Related Questions