RE: [PHP-DB] Building a user preference site
Thanks Rich, I am unclear how to merge the login to the preferences. Check out my code for my login. Right below it is the login2.php,login_done.html,admin.php where will I merge the user preferences portion within this script.. Thanks for all your help.. Here is the test url -> http://www.planttel.com/newsite2/login.php Username: Password: login($username, $password); if (!$login) { include("login_error.html"); } else { include("login/html/login_done.html"); } ?> --- is_logged(); if (!$login_check) { include("/home/plantcom/planttel-www/newsite2/login/html/nologin.html"); } else { include("/home/plantcom/planttel-www/newsite2/member/home.php"); } ?> -Original Message- From: Rich Buggy [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 05, 2002 11:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Building a user preference site > 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 a > Mysql database that contains all the user info. How do I START developing a > 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. Rich -- 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] -- 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]
Re: [PHP-DB] Building a user preference site
> 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 a > Mysql database that contains all the user info. How do I START developing a > 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. Rich -- 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]
Re: [PHP-DB] Building a user preference site
use either sessions or cookies. ur choice. look @ the manual on both. Neil - Original Message - From: Danny Kelly <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 05, 2002 6:42 PM Subject: [PHP-DB] Building a user preference site > Hello, > 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 a > Mysql database that contains all the user info. How do I START developing a > site like this. Thanks, Dan > > > -- > 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] > -- 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]
[PHP-DB] Building a user preference site
Hello, 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 a Mysql database that contains all the user info. How do I START developing a site like this. Thanks, Dan -- 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]