NotGiven wrote:
**fixed top-posting **
[color=blue]
> "Justin Koivisto" <spam@koivi.com> wrote in message
> news:dmE2d.44$AU4.2064@news7.onvoy.net...
>[color=green]
>>NotGiven wrote:
>>[color=darkred]
>>>I probably used the wrong term then. I meant user specific details or
>>>preferences.[/color]
>>
>>"visitor website preferences" may be a bit easier to grasp.
>>
>>The first thing you need to do is how you will identify which user is
>>which. Do they log in? Is there a cookie set? In certain applications it
>>may be based on IP address...
>>
>>Once you have that figured out, then you can decide how to handle it.
>>
>>For instance, say that you have people log in with a unique username....
>>
>>There are a million and 3 ways to do this, but here is one that may be
>>easy to implement:
>>
>>table user_preferences{
>> username // the name of the user that logged in
>> key // something to identify the preference
>> value // the value of this preference
>>}
>>
>>Then, for each preference that a user has changed from defualt there'd be
>>a new row:
>>
>>koivi, date_format, 'Y-m-d'
>>koivi, show_post_time, 0
>>koivi, bg_color, '#009'
>>koivi, font_color, '#ccc'
>>...
>>
>>Then when you load them (you'll likely already have some defaults
>>configured somewhere), just do:
>>
>>SELECT key, value FROM user_preferences WHERE username = 'koivi'
>>
>>Then each row will have a key (or preference) and the value this user
>>likes.[/color]
>
> thanks.
>
> I have users log in using usique userID & password and sessions variable is
> assigned identifying them uniquely. In the login process, I guess I could
> do another search of the preferences table and assign them a session var as
> well.
>
> When I get to a page where user preference settings, I would simply
> reference the $_SESISON['var'], right?[/color]
As I said, there are many ways of doing it, that sounds like one that
would work.
--
Justin Koivisto -
spam@koivi.com http://www.koivi.com