[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PHP and user login stuff



Quiet here today.  Are people coding?

I am working on the user signup form.  I was hoping to have it up by now
but hacking through it all is a little slow.  Anyway, a preliminary
version should appear soon, hopefully tonight or tomorrow.

Also, I've devised a script called connect.php3.  It is intended to be
included from other PHP scripts, so we don't have to repeat the
connection commands in each one.  After including it, the PHP program
can simply reference $conn to do any database stuff.

As an added bonus, there is a LOT of stuff we can add to connect.php3,
like user and permissions checks.  For example, we would be able to
write a PHP program like this:

$rolecheck = 4;  // or whatever, see below
include "connect.php3";

connect.php3 would check to see if $rolecheck exists.  If it does, it
would verify that the currently logged in user has access to that
specific role.  If not, it would exit and the PHP program would not
run.  This way we wouldn't have to write a check in every script.

If we keep stats on user logins, how are we going to determine when the
user logs in?  If he uses a form, it's easy, but if he uses cookies, he
wouldn't necessarily have to go to a certain page.  And I'd rather not
have to keep statistics on EVERY page a logged in user views.  Just the
number of sessions.  Is there an efficient way, for example, to
determine the first time a user uses the system every day?

On the subject of users, what if they don't have cookies enabled?  Will
they have to type their login info EVERY time they do anything, or
should we use HTTP authentication or GET/POST variables (which would be
cleared every time they visit a static page)?

Any thoughts?