> I am trying to figure out how to setup a user preference system. When the
> user successfully
> logs in they will go to a page that will display their preferences. I have
> Mysql database that contains all the user info. How do I START developing
> site like this. Thanks, Dan

  What  I find usually works is this.

1. User logs in and a session variable is set indicating who is currently
logged in.
2. When the user requests a page, gather together the default settings
3. Look up the users preferences in the MySQL database and merge them in to
the default settings (that way you can add additional preference settings
later without breaking your code)
4. Display the page using the merged setting.

  If no one is logged in the skip step 3 so they see the default settings.

  When the user changes their preferences save the changes to the database.
That will allow them to log in from anywhere and retrieve their preferences.

  Don't trying using cookies to store preferences unless you want the
preferences to apply to that browser (rather than user). Anyone using a
shared machine will get very annoyed and the preferences won't be portable.
Saving preferences in session also won't work because they will only last as
long as the session. Loading user preferences in to session variables when
the user logs in is ok and you may want to look at that.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to