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


----------------------------------------------------------------------------
------------
<!-- login.php -->
<?php require('prepend.php'); ?>
<?php pageStart('login'); ?>

<br>
  <form method="post" action="login2.php" name="">
<center><table BORDER=0 CELLSPACING=0 BGCOLOR="#CECFCE" >
<tr>
<td BGCOLOR="#FFFFFF"></td>
</tr>

<tr>
<td ALIGN=CENTER VALIGN=CENTER>
<table BORDER=0 CELLSPACING=0 CELLPADDING=8 BGCOLOR="#EFEFEF" >
<tr>
<td ALIGN=RIGHT WIDTH="40%"><b><font
face="verdana,arial,geneva,helvetica"><font
size=-1>Username:</font></font></b></td>

<td><input TYPE="TEXT" SIZE=15 NAME="username"></td>
</tr>

<tr>
<td ALIGN=RIGHT WIDTH="40%"><b><font
face="verdana,arial,geneva,helvetica"><font
size=-1>Password:</font></font></b></td>

<td><input TYPE="password" SIZE="15" NAME="password"></td>
</tr>

<tr>
<td ALIGN=CENTER COLSPAN="2">
<center><input TYPE="SUBMIT" VALUE="   Login   "></center>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td BGCOLOR="#FFFFFF"></td>
</tr>
</table></center></form>

<?php pageFinish(); ?>
----------------------------------------------------------------------------
--------

<!-- login2.php -->

<?
require("login/backend.php");

if (!$username || !$password) {

        include("login/html/login_notext.html");

}

$login = $authlib->login($username, $password);

if (!$login) {

        include("login_error.html");

}

else {

        include("login/html/login_done.html");

}

?>
----------------------------------------------------------------------------
---------------

<!-- login_done.php -->

<?php

header("Location: member/admin.php");
exit;

?>
----------------------------------------------------------------------------
----------------
<!-- admin.php -->
<?

require("backend.php");

$login_check = $authlib->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]

Reply via email to